diff options
author | Rob Anderton <rob.anderton@thewebfellas.com> | 2009-03-09 12:51:55 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-03-09 12:52:14 +0000 |
commit | faf4ba6b79e56dde383a8761fb1f485fcd07c72b (patch) | |
tree | 10f9b049f4840ad5a59bd97729784d52de22451d /activerecord/lib/active_record | |
parent | 277c799d58be4b3e0e885d7b3fd6d954facc111b (diff) | |
download | rails-faf4ba6b79e56dde383a8761fb1f485fcd07c72b.tar.gz rails-faf4ba6b79e56dde383a8761fb1f485fcd07c72b.tar.bz2 rails-faf4ba6b79e56dde383a8761fb1f485fcd07c72b.zip |
Allow find(:last) :order be a symbol [#2024 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index d8337602e8..edc145985d 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1537,7 +1537,7 @@ module ActiveRecord #:nodoc: end def reverse_sql_order(order_query) - reversed_query = order_query.split(/,/).each { |s| + reversed_query = 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)$/) |