From 2d80dc0cd29895230eaaae4595e249d582439298 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 8 Apr 2014 20:49:22 -0700 Subject: loop over cores twice to make the collector implementation more convenient --- lib/arel/visitors/mssql.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/arel/visitors/mssql.rb b/lib/arel/visitors/mssql.rb index cc5e74af1f..fdf37081dc 100644 --- a/lib/arel/visitors/mssql.rb +++ b/lib/arel/visitors/mssql.rb @@ -28,7 +28,7 @@ module Arel end is_select_count = false - sql = o.cores.map { |x| + o.cores.each { |x| core_order_by = row_num_literal determine_order_by(o.orders, x) if select_count? x x.projections = [core_order_by] @@ -36,9 +36,9 @@ module Arel else x.projections << core_order_by end + } - visit_Arel_Nodes_SelectCore x - }.join + sql = o.cores.map { |x| visit_Arel_Nodes_SelectCore x }.join sql = "SELECT _t.* FROM (#{sql}) as _t WHERE #{get_offset_limit_clause(o)}" # fixme count distinct wouldn't work with limit or offset -- cgit v1.2.3