From dddf2d1f095230fde5e8704632df1ecca54e5ca6 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sat, 14 Aug 2010 18:29:32 -0700 Subject: basic updates are working --- lib/arel/visitors/to_sql.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/arel/visitors') diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index d47c621f6a..41d1299948 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_UpdateStatement o + [ + "UPDATE #{visit o.relation}", + ("WHERE #{o.wheres.map { |x| visit x }.join ' AND '}" unless o.wheres.empty?) + ].compact.join ' ' + end + def visit_Arel_Nodes_InsertStatement o [ "INSERT INTO #{visit o.relation}", -- cgit v1.2.3