Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use blank? instead of present?, mark SQL literals as SQL literals

Conflicts:

	activerecord/lib/active_record/relation/query_methods.rb
  • Loading branch information...
commit ffdda4ddfb76fec92faea714f03a37baf75351ef 1 parent b28cafe
@tenderlove tenderlove authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 activerecord/lib/active_record/relation/query_methods.rb
View
10 activerecord/lib/active_record/relation/query_methods.rb
@@ -99,11 +99,11 @@ def reverse_order
order_clause = arel.order_clauses.join(', ')
relation = except(:order)
- unless order_clauses.blank?
- relation.order(reverse_sql_order(order_clause))
- else
- relation.order("#{@klass.table_name}.#{@klass.primary_key} DESC")
- end
+ order = order_clause.blank? ?
+ "#{@klass.table_name}.#{@klass.primary_key} DESC" :
+ reverse_sql_order(order_clause)
+
+ relation.order Arel::SqlLiteral.new order
end
def arel
Please sign in to comment.
Something went wrong with that request. Please try again.