diff options
Diffstat (limited to 'lib/arel/visitors/to_sql.rb')
-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}", |