diff options
author | Matt Jones + Scott Walker <pairing+mj+sw@gmail.com> | 2011-12-28 09:53:13 -0500 |
---|---|---|
committer | Matt Jones + Scott Walker <pairing+mj+sw@gmail.com> | 2011-12-28 09:53:13 -0500 |
commit | 18fb2d4c022c1d95dc9a40493adbc3880da70dcd (patch) | |
tree | e5b0596adbaa3c267b22b67702f3a56dbc7747ed /activerecord/lib/active_record | |
parent | 4af5252d368cbc12d79f1a7ca87e7367f7daa40b (diff) | |
download | rails-18fb2d4c022c1d95dc9a40493adbc3880da70dcd.tar.gz rails-18fb2d4c022c1d95dc9a40493adbc3880da70dcd.tar.bz2 rails-18fb2d4c022c1d95dc9a40493adbc3880da70dcd.zip |
allow reorder to affect eager loading correctly
Diffstat (limited to 'activerecord/lib/active_record')
-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 |