diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-14 18:29:32 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-14 18:29:32 -0700 |
commit | dddf2d1f095230fde5e8704632df1ecca54e5ca6 (patch) | |
tree | 29386e06582ed029cf94218a87b7f71d88866254 /lib/arel/visitors | |
parent | 74a27a0d83ecd7ed4975851ea92ee517a1581faf (diff) | |
download | rails-dddf2d1f095230fde5e8704632df1ecca54e5ca6.tar.gz rails-dddf2d1f095230fde5e8704632df1ecca54e5ca6.tar.bz2 rails-dddf2d1f095230fde5e8704632df1ecca54e5ca6.zip |
basic updates are working
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 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}", |