diff options
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/select_manager.rb | 3 | ||||
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/arel/select_manager.rb b/lib/arel/select_manager.rb index 22e3dd07e0..8f5995e32c 100644 --- a/lib/arel/select_manager.rb +++ b/lib/arel/select_manager.rb @@ -151,10 +151,9 @@ module Arel else node_class = Nodes::With end - @ast.with = node_class.new(*subqueries) + @ast.with = node_class.new(subqueries.flatten) end - def take limit @ast.limit = Nodes::Limit.new(limit) @ctx.top = Nodes::Top.new(limit) diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index 37c6a533ed..e021b5a707 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -151,11 +151,11 @@ eowarn end def visit_Arel_Nodes_With o - "WITH #{visit o.children}" + "WITH #{o.children.map { |x| visit x }.join(', ')}" end def visit_Arel_Nodes_WithRecursive o - "WITH RECURSIVE #{visit o.children}" + "WITH RECURSIVE #{o.children.map { |x| visit x }.join(', ')}" end def visit_Arel_Nodes_Union o |