Skip to content
Browse files

Preserving :include options for hmt association with an order but wit…

…hout conditions [#5262 state:resolved]
  • Loading branch information...
1 parent 515917f commit 066518295032a8e3f3468737337b8c8299442867 @marklazz marklazz committed with tenderlove Sep 15, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/association_preload.rb
View
2 activerecord/lib/active_record/association_preload.rb
@@ -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)

0 comments on commit 0665182

Please sign in to comment.
Something went wrong with that request. Please try again.