diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-10 11:14:23 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-10 11:14:23 -0700 |
commit | 048478bf152a495a2d0ba17990d6966970a38cff (patch) | |
tree | ae4bc31be51f32c22f9225509d1cdfd8d5e7bd63 /lib/arel/visitors/to_sql.rb | |
parent | 4b187a19b16ed4cb0b248e4e4d658a4ef6e8f26e (diff) | |
parent | 4a898b3c682f74890065e28ffe03899f23a4ab20 (diff) | |
download | rails-048478bf152a495a2d0ba17990d6966970a38cff.tar.gz rails-048478bf152a495a2d0ba17990d6966970a38cff.tar.bz2 rails-048478bf152a495a2d0ba17990d6966970a38cff.zip |
Merge pull request #255 from byroot/insert-select
Allow INSERT INTO <table> SELECT queries
Diffstat (limited to 'lib/arel/visitors/to_sql.rb')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index e1b46eb6e6..22f7943ab9 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -127,7 +127,13 @@ module Arel }.join ', '})" end - maybe_visit o.values, collector + if o.values + maybe_visit o.values, collector + elsif o.select + maybe_visit o.select, collector + else + collector + end end def visit_Arel_Nodes_Exists o, collector |