Skip to content

Commit

Permalink
Preserving :include options for hmt association with an order but wit…
Browse files Browse the repository at this point in the history
…hout conditions [rails#5262 state:resolved]
  • Loading branch information
marklazz authored and tenderlove committed Sep 28, 2010
1 parent 515917f commit 0665182
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/association_preload.rb
Expand Up @@ -283,7 +283,7 @@ def preload_through_records(records, reflection, through_association)
through_records.flatten!
else
options = {}
options[:include] = reflection.options[:include] || reflection.options[:source] if reflection.options[:conditions]
options[:include] = reflection.options[:include] || reflection.options[:source] if reflection.options[:conditions] || reflection.options[:order]
options[:order] = reflection.options[:order]
options[:conditions] = reflection.options[:conditions]
records.first.class.preload_associations(records, through_association, options)
Expand Down

0 comments on commit 0665182

Please sign in to comment.