diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-08 20:49:26 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-08 20:49:26 -0700 |
commit | 2b61973597f1204f9ac58f517716e6d7811239e4 (patch) | |
tree | 8feee57649c19ad1611ced180c69469722744f4d /lib/arel | |
parent | d6a9267aec4bf845926cef725a2d733a6a7ef361 (diff) | |
parent | 2d80dc0cd29895230eaaae4595e249d582439298 (diff) | |
download | rails-2b61973597f1204f9ac58f517716e6d7811239e4.tar.gz rails-2b61973597f1204f9ac58f517716e6d7811239e4.tar.bz2 rails-2b61973597f1204f9ac58f517716e6d7811239e4.zip |
Merge branch 'master' into collector
* master:
loop over cores twice to make the collector implementation more convenient
Diffstat (limited to 'lib/arel')
-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 |