diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-23 13:28:08 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-23 13:28:08 -0700 |
commit | 8966434f2a0d7aaff5fdea26b40dc37e89fee239 (patch) | |
tree | 00a162631b5af1752f77041d2ad59d362dd31396 /lib | |
parent | 2579fec805f23903dd6c4f1726198e010f5a9a54 (diff) | |
download | rails-8966434f2a0d7aaff5fdea26b40dc37e89fee239.tar.gz rails-8966434f2a0d7aaff5fdea26b40dc37e89fee239.tar.bz2 rails-8966434f2a0d7aaff5fdea26b40dc37e89fee239.zip |
making sure update delegates to update and insert delegates to insert
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/crud.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/arel/crud.rb b/lib/arel/crud.rb index 2bf5f85823..ac5f70673b 100644 --- a/lib/arel/crud.rb +++ b/lib/arel/crud.rb @@ -6,22 +6,21 @@ module Arel def update values um = UpdateManager.new @engine - if String === values - values = SqlLiteral.new values + if Nodes::SqlLiteral === values um.table @ctx.froms.last else um.table values.first.first.relation end um.set values um.wheres = @ctx.wheres - @engine.connection.execute um.to_sql + @engine.connection.update um.to_sql, 'AREL' end # FIXME: this method should go away def insert values im = InsertManager.new @engine im.insert values - @engine.connection.execute im.to_sql + @engine.connection.insert im.to_sql end def delete |