aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorBrian Christian <brchristian@gmail.com>2016-03-09 19:40:23 -0800
committerBrian Christian <brchristian@gmail.com>2018-07-19 21:35:43 -0700
commit022eadddbac826cf663630d58b689ccdcb5e3777 (patch)
tree1be6a99132b7decb871dc5c85253a164df52d914 /activerecord
parent83f755ff66b9152eb0c66b279757310040b23d18 (diff)
downloadrails-022eadddbac826cf663630d58b689ccdcb5e3777.tar.gz
rails-022eadddbac826cf663630d58b689ccdcb5e3777.tar.bz2
rails-022eadddbac826cf663630d58b689ccdcb5e3777.zip
don't impose primary key order if limit() is defined
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb2
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