diff options
author | Jiri Pospisil <mekishizufu@gmail.com> | 2014-06-12 17:57:54 +0200 |
---|---|---|
committer | Jiri Pospisil <mekishizufu@gmail.com> | 2014-06-12 17:57:54 +0200 |
commit | 19af353a8bbfb30898f1a32c3f5e39d557d34d65 (patch) | |
tree | 2001f73e14f2a6dd391d99b63936830e477b39e5 /lib | |
parent | 22136deb66c79e37e68ea0f061389a3317601c92 (diff) | |
download | rails-19af353a8bbfb30898f1a32c3f5e39d557d34d65.tar.gz rails-19af353a8bbfb30898f1a32c3f5e39d557d34d65.tar.bz2 rails-19af353a8bbfb30898f1a32c3f5e39d557d34d65.zip |
Make sure visit_Arel_Nodes_With works with collectors
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 5 |
1 files changed, 3 insertions, 2 deletions
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 |