Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git@github.com:rails/rails

  • Loading branch information...
commit ee5520a0a5ea83843ce88f6b9550e3c36b8cdd49 2 parents 41e9414 + 5463823
@jeremy jeremy authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/base.rb
View
4 activerecord/lib/active_record/base.rb
@@ -1542,12 +1542,12 @@ def find_last(options)
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(',')
Please sign in to comment.
Something went wrong with that request. Please try again.