diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-18 11:32:44 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-18 11:32:44 -0700 |
commit | 0403efa4c6ad926a61dd0d134d63d962238e2c4f (patch) | |
tree | 20b815921da4a85f18b8251037eed313f3268eda /lib/arel/visitors | |
parent | e9a22ec1afa62ed6be75427315a3a650fc41e629 (diff) | |
download | rails-0403efa4c6ad926a61dd0d134d63d962238e2c4f.tar.gz rails-0403efa4c6ad926a61dd0d134d63d962238e2c4f.tar.bz2 rails-0403efa4c6ad926a61dd0d134d63d962238e2c4f.zip |
delete manager added
Diffstat (limited to 'lib/arel/visitors')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index fd467495ae..0e5998c573 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -12,6 +12,13 @@ module Arel end private + def visit_Arel_Nodes_DeleteStatement o + [ + "DELETE FROM #{visit o.relation}", + ("WHERE #{o.wheres.map { |x| visit x }.join ' AND '}" unless o.wheres.empty?) + ].compact.join ' ' + end + def visit_Arel_Nodes_UpdateStatement o [ "UPDATE #{visit o.relation}", |