diff options
author | Brian Christian <brchristian@gmail.com> | 2016-03-09 19:40:23 -0800 |
---|---|---|
committer | Brian Christian <brchristian@gmail.com> | 2018-07-19 21:35:43 -0700 |
commit | 022eadddbac826cf663630d58b689ccdcb5e3777 (patch) | |
tree | 1be6a99132b7decb871dc5c85253a164df52d914 /activerecord/lib/active_record/relation | |
parent | 83f755ff66b9152eb0c66b279757310040b23d18 (diff) | |
download | rails-022eadddbac826cf663630d58b689ccdcb5e3777.tar.gz rails-022eadddbac826cf663630d58b689ccdcb5e3777.tar.bz2 rails-022eadddbac826cf663630d58b689ccdcb5e3777.zip |
don't impose primary key order if limit() is defined
Diffstat (limited to 'activerecord/lib/active_record/relation')
-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 c5562c1ff0..93f3b67686 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -550,7 +550,7 @@ module ActiveRecord end def ordered_relation - if order_values.empty? && primary_key + if order_values.empty? && primary_key && limit_value.blank? order(arel_attribute(primary_key).asc) else self |