diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-27 10:26:39 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-27 10:26:39 -0700 |
commit | 9d396ee8195e31f646e0b89158ed96f4db4ab38f (patch) | |
tree | d5bba453fc2629b24e92191bbbc9cb0e0bdcc0dc /activerecord/lib/active_record/relation/query_methods.rb | |
parent | fa2bfd832c1d1e997d93c2269a485cc74782c86d (diff) | |
parent | 18d307ed94ee9a8cd2dca117597f9e6afd1b6faa (diff) | |
download | rails-9d396ee8195e31f646e0b89158ed96f4db4ab38f.tar.gz rails-9d396ee8195e31f646e0b89158ed96f4db4ab38f.tar.bz2 rails-9d396ee8195e31f646e0b89158ed96f4db4ab38f.zip |
Merge pull request #2309 from smasry/master
Unmangaling reverse_sql_order when function is used
Diffstat (limited to 'activerecord/lib/active_record/relation/query_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 1654ae1eac..3a7b245c51 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -312,7 +312,7 @@ module ActiveRecord when String, Symbol o.to_s.split(',').collect do |s| s.strip! - s.gsub!(/\sasc\Z/i, ' DESC') || s.gsub!(/\sdesc\Z/i, ' ASC') || s.concat(' DESC') + (s if s =~ /\(/) || s.gsub!(/\sasc\Z/i, ' DESC') || s.gsub!(/\sdesc\Z/i, ' ASC') || s.concat(' DESC') end else o |