From 19af353a8bbfb30898f1a32c3f5e39d557d34d65 Mon Sep 17 00:00:00 2001 From: Jiri Pospisil Date: Thu, 12 Jun 2014 17:57:54 +0200 Subject: Make sure visit_Arel_Nodes_With works with collectors --- lib/arel/visitors/to_sql.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/arel') diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index a1dee43cab..7f74ebb402 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -298,8 +298,9 @@ module Arel raise NotImplementedError, 'DISTINCT ON not implemented for this db' end - def visit_Arel_Nodes_With o - "WITH #{o.children.map { |x| visit x }.join(', ')}" + def visit_Arel_Nodes_With o, collector + collector << "WITH " + inject_join o.children, collector, ', ' end def visit_Arel_Nodes_WithRecursive o, collector -- cgit v1.2.3