diff --git a/lib/noosfero/api/v1/categories.rb b/lib/noosfero/api/v1/categories.rb index fa8d1f6..fb90f73 100644 --- a/lib/noosfero/api/v1/categories.rb +++ b/lib/noosfero/api/v1/categories.rb @@ -11,7 +11,7 @@ module Noosfero include_parent = params[:include_parent] == 'true' include_children = params[:include_children] == 'true' - categories = type.nil? ? environment.categories : environment.categories.find(:all, :conditions => {:type => type}) + categories = type.nil? ? environment.categories : environment.categories.where(:type => type) present categories, :with => Entities::Category, parent: include_parent, children: include_children end -- libgit2 0.21.2