diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-13 19:42:36 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-13 19:42:36 -0300 |
commit | 282bb10a6dcd7e488ea441dd40033bf0f9ecb6c3 (patch) | |
tree | d0bddaaecd9791e4476119241e278130e4d23526 /lib/arel/visitors/to_sql.rb | |
parent | 22136deb66c79e37e68ea0f061389a3317601c92 (diff) | |
parent | b4bec045a8bb89c2a2cfc06a8071b34a97723de7 (diff) | |
download | rails-282bb10a6dcd7e488ea441dd40033bf0f9ecb6c3.tar.gz rails-282bb10a6dcd7e488ea441dd40033bf0f9ecb6c3.tar.bz2 rails-282bb10a6dcd7e488ea441dd40033bf0f9ecb6c3.zip |
Merge pull request #289 from mekishizufu/fix_with_statements
Fix WITH statements
Diffstat (limited to 'lib/arel/visitors/to_sql.rb')
-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 |