aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-04-08 20:49:22 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-04-08 20:49:22 -0700
commit2d80dc0cd29895230eaaae4595e249d582439298 (patch)
tree6f1986891724f477bc4f27d0e28fb20cbe3d8844 /lib/arel
parent0d3e9161794e95995ee1f2dcfc063782758e64c0 (diff)
downloadrails-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')
-rw-r--r--lib/arel/visitors/mssql.rb6
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