diff options
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 4a07fbc1e1..48db9fb942 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1768,17 +1768,15 @@ module ActiveRecord #:nodoc: 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) |