Commit 0eba5453a0cc705a912a9d88bade81ad76457f65

Authored by Rodrigo Souto
1 parent 991c68a4

api: use where search on categories

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
lib/noosfero/api/v1/categories.rb
@@ -11,7 +11,7 @@ module Noosfero @@ -11,7 +11,7 @@ module Noosfero
11 include_parent = params[:include_parent] == 'true' 11 include_parent = params[:include_parent] == 'true'
12 include_children = params[:include_children] == 'true' 12 include_children = params[:include_children] == 'true'
13 13
14 - categories = type.nil? ? environment.categories : environment.categories.find(:all, :conditions => {:type => type}) 14 + categories = type.nil? ? environment.categories : environment.categories.where(:type => type)
15 present categories, :with => Entities::Category, parent: include_parent, children: include_children 15 present categories, :with => Entities::Category, parent: include_parent, children: include_children
16 end 16 end
17 17