Commit d3b5575cae625b0a00d92be119353dd768909b9f

Authored by Victor Costa
1 parent 3a07ccbb

api: fix ambiguity with children_count in article search

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
lib/noosfero/api/v1/search.rb
@@ -18,7 +18,7 @@ module Noosfero @@ -18,7 +18,7 @@ module Noosfero
18 scope = scope.where(:type => params[:type]) if params[:type] && !(params[:type] == 'Article') 18 scope = scope.where(:type => params[:type]) if params[:type] && !(params[:type] == 'Article')
19 scope = scope.where(make_conditions_with_parameter(params)) 19 scope = scope.where(make_conditions_with_parameter(params))
20 scope = scope.joins(:categories).where(:categories => {:id => params[:category_ids]}) if params[:category_ids].present? 20 scope = scope.joins(:categories).where(:categories => {:id => params[:category_ids]}) if params[:category_ids].present?
21 - scope = scope.where('children_count > 0') if params[:has_children].present? 21 + scope = scope.where('articles.children_count > 0') if params[:has_children].present?
22 query = params[:query] || "" 22 query = params[:query] || ""
23 order = "more_recent" 23 order = "more_recent"
24 24