Skip to content

Commit e711055

Browse files
committed
Fix limit for complex count.
1 parent 3f6d16e commit e711055

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/arel/visitors/sqlserver.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def visit_Arel_Nodes_SelectStatementForComplexCount(o)
101101
# joins = correlated_safe_joins
102102
core = o.cores.first
103103
orders = rowtable_orders(o)
104+
o.limit.expr = o.limit.expr.to_i + o.offset.expr.to_i if o.limit
104105
[ "SELECT COUNT([count]) AS [count_id]",
105106
"FROM (",
106107
"SELECT",

0 commit comments

Comments
 (0)