diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-28 17:03:37 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-28 17:03:37 -0800 |
commit | 780a222dc2e888646aba4b6908ea78dba9d50722 (patch) | |
tree | 37a07bdd0dd87f3bacd7aa678ca6e2b91f5db9e0 /activerecord/lib | |
parent | f06074f365932f47e108004b93f05b259cf0c5db (diff) | |
parent | 18fb2d4c022c1d95dc9a40493adbc3880da70dcd (diff) | |
download | rails-780a222dc2e888646aba4b6908ea78dba9d50722.tar.gz rails-780a222dc2e888646aba4b6908ea78dba9d50722.tar.bz2 rails-780a222dc2e888646aba4b6908ea78dba9d50722.zip |
Merge pull request #4216 from edgecase/master_fix_reorder_with_limited_ids
allow reorder to affect eager loading correctly
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 311bf4dc0f..e58c726e09 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -249,7 +249,7 @@ module ActiveRecord end def construct_limited_ids_condition(relation) - orders = relation.order_values.map { |val| val.presence }.compact + orders = (relation.reorder_value || relation.order_values).map { |val| val.presence }.compact values = @klass.connection.distinct("#{@klass.connection.quote_table_name table_name}.#{primary_key}", orders) relation = relation.dup |