Skip to content

Commit

Permalink
Correct AR syntax helps sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
pat committed May 3, 2008
1 parent 16b600b commit 670d307
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/thinking_sphinx/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ def instances_from_results(results, options = {}, klass = nil)
else
ids = results.collect { |result| result[:doc] }
instances = klass.find(
*(ids + [{:include => options[:include], :select => options[:select]}])
:all,
:conditions => {klass.primary_key.to_sym => ids},
:include => options[:include],
:select => options[:select]
)
ids.collect { |obj_id| instances.detect { |obj| obj.id == obj_id } }
end
Expand Down

0 comments on commit 670d307

Please sign in to comment.