Skip to content

Commit 29e7e5d

Browse files
committed
Only use our SelectManager#order if the visitor is SQLServer. Fixes #93
1 parent 0c91455 commit 29e7e5d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/arel/visitors/sqlserver.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ class SelectManager < Arel::TreeManager
3232
# a colleciton of them reliably as well as using their true object attributes to mutate them
3333
# to grouping objects for the inner sql during a select statment with an offset/rownumber. So this
3434
# is here till ActiveRecord & ARel does this for us instead of using SqlLiteral objects.
35+
alias :order_without_sqlserver :order
3536
def order(*exprs)
37+
return order_without_sqlserver(*exprs) unless Arel::Visitors::SQLServer === @visitor
3638
@ast.orders.concat(exprs.map{ |x|
3739
case x
3840
when Arel::Attributes::Attribute

0 commit comments

Comments
 (0)