Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use array of orders instead of string concatenation

  • Loading branch information...
commit af9f9dd02c5539df0f05cb92e0799dc9e0bc8d46 1 parent 0587462
Emilio Tagua miloops authored
Showing with 5 additions and 7 deletions.
  1. +5 −7 activerecord/lib/active_record/base.rb
12 activerecord/lib/active_record/base.rb
View
@@ -1750,17 +1750,15 @@ def construct_group(group, having, scope = :auto)
end
def construct_order(order, scope = :auto)
- sql = ''
+ orders = []
scoped_order = scope[:order] if scope
if order
- sql << order.to_s
- if scoped_order && scoped_order != order
- sql << ", #{scoped_order}"
- end
+ orders << order
+ orders << scoped_order if scoped_order && scoped_order != order
else
- sql << scoped_order.to_s if scoped_order
+ orders << scoped_order if scoped_order
end
- sql
+ orders
end
def construct_limit(options, scope = :auto)
Please sign in to comment.
Something went wrong with that request. Please try again.