Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…hout conditions [#5262 state:resolved]
  • Loading branch information...
commit 066518295032a8e3f3468737337b8c8299442867 1 parent 515917f
@marklazz marklazz authored tenderlove committed
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)
Please sign in to comment.
Something went wrong with that request. Please try again.