File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
lib/active_record/connection_adapters Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -394,7 +394,7 @@ def add_limit_offset!(sql, options)
394394 sql . sub! ( /^\s *SELECT(\s +DISTINCT)?/i , "SELECT * FROM (SELECT TOP #{ options [ :limit ] } * FROM (SELECT#{ $1} TOP #{ options [ :limit ] + options [ :offset ] } " )
395395 sql << ") AS tmp1"
396396 if options [ :order ]
397- options [ : order] = options [ :order ] . split ( ',' ) . map do |field |
397+ order = options [ :order ] . split ( ',' ) . map do |field |
398398 parts = field . split ( " " )
399399 tc = parts [ 0 ]
400400 if sql =~ /\. \[ / and tc =~ /\. / # if column quoting used in query
@@ -408,7 +408,7 @@ def add_limit_offset!(sql, options)
408408 end
409409 parts . join ( ' ' )
410410 end . join ( ', ' )
411- sql << " ORDER BY #{ change_order_direction ( options [ : order] ) } ) AS tmp2 ORDER BY #{ options [ : order] } "
411+ sql << " ORDER BY #{ change_order_direction ( order ) } ) AS tmp2 ORDER BY #{ order } "
412412 else
413413 sql << " ) AS tmp2"
414414 end
You can’t perform that action at this time.
0 commit comments