Browse files

Fix limit for complex count.

  • Loading branch information...
1 parent 3f6d16e commit e7110557967c4b5df59075ae5606ee48b59693a9 @metaskills metaskills committed Jan 13, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/arel/visitors/sqlserver.rb
View
1 lib/arel/visitors/sqlserver.rb
@@ -101,6 +101,7 @@ def visit_Arel_Nodes_SelectStatementForComplexCount(o)
# joins = correlated_safe_joins
core = o.cores.first
orders = rowtable_orders(o)
+ o.limit.expr = o.limit.expr.to_i + o.offset.expr.to_i if o.limit
[ "SELECT COUNT([count]) AS [count_id]",
"FROM (",
"SELECT",

0 comments on commit e711055

Please sign in to comment.