diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-18 15:02:15 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-18 15:02:15 -0700 |
commit | ee5520a0a5ea83843ce88f6b9550e3c36b8cdd49 (patch) | |
tree | de4b713031908885bc53d8b6d45cdad2121e7017 | |
parent | 41e9414b60e8d042bacf2f8d61d7efc07111417a (diff) | |
parent | 5463823df38310d392a3f87d633dce9b4150259a (diff) | |
download | rails-ee5520a0a5ea83843ce88f6b9550e3c36b8cdd49.tar.gz rails-ee5520a0a5ea83843ce88f6b9550e3c36b8cdd49.tar.bz2 rails-ee5520a0a5ea83843ce88f6b9550e3c36b8cdd49.zip |
Merge branch 'master' of git@github.com:rails/rails
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 1400096ffb..8a65945e61 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1542,12 +1542,12 @@ module ActiveRecord #:nodoc: end def reverse_sql_order(order_query) - reversed_query = order_query.to_s.split(/,/).each { |s| + order_query.to_s.split(/,/).each { |s| if s.match(/\s(asc|ASC)$/) s.gsub!(/\s(asc|ASC)$/, ' DESC') elsif s.match(/\s(desc|DESC)$/) s.gsub!(/\s(desc|DESC)$/, ' ASC') - elsif !s.match(/\s(asc|ASC|desc|DESC)$/) + else s.concat(' DESC') end }.join(',') |