diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-29 23:18:33 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-29 23:18:33 -0300 |
commit | 92c5a2244ec3e58fd5e70e7dd2d7882b80183c80 (patch) | |
tree | 62de003cb6d3c5f1088bf9a98d06891ff4927833 /activerecord/lib/active_record | |
parent | fbaae891ac5361a03aaea07bc95bc11b3c6e11fd (diff) | |
download | rails-92c5a2244ec3e58fd5e70e7dd2d7882b80183c80.tar.gz rails-92c5a2244ec3e58fd5e70e7dd2d7882b80183c80.tar.bz2 rails-92c5a2244ec3e58fd5e70e7dd2d7882b80183c80.zip |
Revert change on ActiveRecord::Relation#order method that prepends new
order on the old ones
The previous behavior added a major backward incompatibility since it
impossible to have a upgrade path without major changes on the
application code.
We are taking the most conservative path to be consistent with the idea
of having a smoother upgrade on Rails 4.
We are reverting the behavior for what was in Rails 3.x and,
if needed, we will implement a new API to prepend the order clauses in
Rails 4.1.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index d0c56ac3d0..49b632c4c7 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -299,7 +299,7 @@ module ActiveRecord arg } - self.order_values = args.concat self.order_values + self.order_values += args self end @@ -311,7 +311,7 @@ module ActiveRecord # # User.order('email DESC').reorder('id ASC').order('name ASC') # - # generates a query with 'ORDER BY name ASC, id ASC'. + # generates a query with 'ORDER BY id ASC, name ASC'. def reorder(*args) check_if_method_has_arguments!("reorder", args) spawn.reorder!(*args) |