diff options
author | Samer Masry <smasry@dryblis.com> | 2011-07-27 10:17:25 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:20 -0700 |
commit | c751bb1ac25c1b563cb55da2a25284f430e5e40e (patch) | |
tree | a93214fc0920674f993c3ccd28902bf62c072c10 /activerecord/lib | |
parent | 45f9c2b3619d96867f9c6af7c16d2f5d53f1a17e (diff) | |
download | rails-c751bb1ac25c1b563cb55da2a25284f430e5e40e.tar.gz rails-c751bb1ac25c1b563cb55da2a25284f430e5e40e.tar.bz2 rails-c751bb1ac25c1b563cb55da2a25284f430e5e40e.zip |
Reverse order fix when using function for ActiveRecord::QueryMethods Fixes #1697
Diffstat (limited to 'activerecord/lib')
-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 |