diff options
author | Elliot Winkler <elliot.winkler@gmail.com> | 2011-07-18 14:56:07 -0600 |
---|---|---|
committer | Elliot Winkler <elliot.winkler@gmail.com> | 2011-07-18 14:56:37 -0600 |
commit | 0e1d617b8b869426960ec25b62620fe1599cb5e6 (patch) | |
tree | 37878130e12ad19210d45239c4f4f1833c76a869 /activerecord/lib | |
parent | b475f74da5ec2ac4048f70d9063a1d4c0d63b546 (diff) | |
download | rails-0e1d617b8b869426960ec25b62620fe1599cb5e6.tar.gz rails-0e1d617b8b869426960ec25b62620fe1599cb5e6.tar.bz2 rails-0e1d617b8b869426960ec25b62620fe1599cb5e6.zip |
ActiveRecord: Fix eager loading so that giving a blank order clause generates valid SQL
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 283115a448..220ead4edb 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -243,7 +243,7 @@ module ActiveRecord end def construct_limited_ids_condition(relation) - orders = relation.order_values + orders = relation.order_values.map(&:presence).compact values = @klass.connection.distinct("#{@klass.connection.quote_table_name table_name}.#{primary_key}", orders) relation = relation.dup |