Permalink
Browse files

porting 0665182 to master. Thanks Marcelo Giorgi

  • Loading branch information...
1 parent c2c6f12 commit 9edaf10fee5184ad427d23b7a0ca17033db1f17a @tenderlove tenderlove committed Sep 28, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/association_preload.rb
@@ -284,7 +284,7 @@ def preload_through_records(records, reflection, through_association)
end
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 9edaf10

Please sign in to comment.