diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-21 09:20:14 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-21 09:20:14 -0700 |
commit | 2b20a488519716be15fbe351f7da39c9fd70f846 (patch) | |
tree | 00f61fcd6fa5590f1cb94d430c1d5f6322de0e7f /lib/arel/crud.rb | |
parent | 0e98ef149cd44dc04d40a8553e1743c5cb6d4a7c (diff) | |
download | rails-2b20a488519716be15fbe351f7da39c9fd70f846.tar.gz rails-2b20a488519716be15fbe351f7da39c9fd70f846.tar.bz2 rails-2b20a488519716be15fbe351f7da39c9fd70f846.zip |
making stuff work on mysql
Diffstat (limited to 'lib/arel/crud.rb')
-rw-r--r-- | lib/arel/crud.rb | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/arel/crud.rb b/lib/arel/crud.rb index e060a82941..640189fbe9 100644 --- a/lib/arel/crud.rb +++ b/lib/arel/crud.rb @@ -13,16 +13,9 @@ module Arel end um.table relation um.set values - - if @head.orders.empty? && @head.limit.nil? - um.wheres = @ctx.wheres - else - head = @head.clone - core = head.cores.first - core.projections = [relation.primary_key] - - um.wheres = [Nodes::In.new(relation.primary_key, [head])] - end + um.take @head.limit + um.order(*@head.orders) + um.wheres = @ctx.wheres @engine.connection.update um.to_sql, 'AREL' end |