diff options
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index c07eca44e3..7ceec40954 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -41,10 +41,9 @@ module ActiveRecord end def reverse_order - relation = spawn - relation.instance_variable_set(:@orders, nil) - order_clause = arel.send(:order_clauses).join(', ') + relation = except(:order) + if order_clause.present? relation.order(reverse_sql_order(order_clause)) else |