Skip to content

Commit

Permalink
Merge a1745d2 into 91912d1
Browse files Browse the repository at this point in the history
  • Loading branch information
susannasiebert committed Dec 23, 2019
2 parents 91912d1 + a1745d2 commit 2c1bac1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/advanced_searches/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ def search
query_segments.push(*additional_query_segments)
param_values.push(*additional_param_values)
end
query = model_class.advanced_search_scope
.where(query_segments.join(boolean_operator), *param_values)
ids = model_class.advanced_search_scope
.where(query_segments.join(boolean_operator), *param_values).pluck(:id)
query = model_class.advanced_search_scope.where("#{model_class.table_name}.id" => ids)
if params['count'].present?
query.order("#{model_class.table_name}.id asc")
.page(params['page'])
Expand Down

0 comments on commit 2c1bac1

Please sign in to comment.