diff options
author | Franck Verrot <franck@verrot.fr> | 2011-07-24 08:17:36 +0200 |
---|---|---|
committer | Franck Verrot <franck@verrot.fr> | 2011-07-24 08:18:04 +0200 |
commit | 77bb0b79f2ed54501046d0e983ef6b10e4bb7b9b (patch) | |
tree | 1ebc2da4210a397cb979155664c6f04f5b07a0ee /activerecord/lib/active_record/relation | |
parent | d33eb07543aed1a07f9efe40ff7edc983b401957 (diff) | |
download | rails-77bb0b79f2ed54501046d0e983ef6b10e4bb7b9b.tar.gz rails-77bb0b79f2ed54501046d0e983ef6b10e4bb7b9b.tar.bz2 rails-77bb0b79f2ed54501046d0e983ef6b10e4bb7b9b.zip |
Ordering with extra spaces was raising a SQL exception
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 8bd4732c0c..1654ae1eac 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -311,6 +311,7 @@ module ActiveRecord o.reverse 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') end else |