diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-08 20:49:22 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-08 20:49:22 -0700 |
commit | 2d80dc0cd29895230eaaae4595e249d582439298 (patch) | |
tree | 6f1986891724f477bc4f27d0e28fb20cbe3d8844 /lib/arel/visitors/mssql.rb | |
parent | 0d3e9161794e95995ee1f2dcfc063782758e64c0 (diff) | |
download | rails-2d80dc0cd29895230eaaae4595e249d582439298.tar.gz rails-2d80dc0cd29895230eaaae4595e249d582439298.tar.bz2 rails-2d80dc0cd29895230eaaae4595e249d582439298.zip |
loop over cores twice to make the collector implementation more convenient
Diffstat (limited to 'lib/arel/visitors/mssql.rb')
-rw-r--r-- | lib/arel/visitors/mssql.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 |