diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-09-04 23:59:40 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-09-05 08:28:11 -0300 |
commit | 708ee9c5ac6ef3ded22a716914a2c46136b5dfe0 (patch) | |
tree | aa7fd1e632eb04752aeae699e48011afe78740e6 /activerecord/lib/active_record/relation/query_methods.rb | |
parent | 16e078d908b79c78016e3a08afdd18a3dc77d40b (diff) | |
download | rails-708ee9c5ac6ef3ded22a716914a2c46136b5dfe0.tar.gz rails-708ee9c5ac6ef3ded22a716914a2c46136b5dfe0.tar.bz2 rails-708ee9c5ac6ef3ded22a716914a2c46136b5dfe0.zip |
Make scoped reorder override previous applied orders
[5528 state:committed]
Diffstat (limited to 'activerecord/lib/active_record/relation/query_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 78fa85e737..6005105cc9 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -6,7 +6,7 @@ module ActiveRecord extend ActiveSupport::Concern attr_accessor :includes_values, :eager_load_values, :preload_values, - :select_values, :group_values, :order_values, :joins_values, :where_values, :having_values, + :select_values, :group_values, :order_values, :reorder_flag, :joins_values, :where_values, :having_values, :limit_value, :offset_value, :lock_value, :readonly_value, :create_with_value, :from_value def includes(*args) @@ -53,7 +53,10 @@ module ActiveRecord def reorder(*args) relation = clone - relation.order_values = args if args.present? + if args.present? + relation.order_values = args + relation.reorder_flag = true + end relation end |