From 0eba5453a0cc705a912a9d88bade81ad76457f65 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Tue, 23 Jun 2015 12:15:17 -0300 Subject: [PATCH] api: use where search on categories --- lib/noosfero/api/v1/categories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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