From 25760a492118886f5ecf570458217be8ea978678 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Wed, 1 Aug 2018 05:31:59 +0900 Subject: Revert "Merge pull request #24131 from brchristian/limit_and_primary_key" This reverts commit d162188dd662a7d9f62ba8431474f50bc35e3e93, reversing changes made to 3576782888c307e3e192c44e332b957cd1174128. Reason: #24131 conflicts the #5153's default order contract, it means that existing apps would be broken by that change. We don't want to break existing apps without a deprecation cycle. --- activerecord/lib/active_record/relation/finder_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 93f3b67686..c5562c1ff0 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 && limit_value.blank? + if order_values.empty? && primary_key order(arel_attribute(primary_key).asc) else self -- cgit v1.2.3