aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-08-10 00:06:30 +0100
committerJon Leighton <j@jonathanleighton.com>2011-08-15 23:10:15 +0100
commitfe0ec855419e1deba47277c96275a16ecf79bc9a (patch)
tree895f2bf111bc9e3e317d717804c48e5975dd326b /activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
parent43b99f290a8070196919a68999db87873257b7b8 (diff)
downloadrails-fe0ec855419e1deba47277c96275a16ecf79bc9a.tar.gz
rails-fe0ec855419e1deba47277c96275a16ecf79bc9a.tar.bz2
rails-fe0ec855419e1deba47277c96275a16ecf79bc9a.zip
Refactor building the update manager
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/mysql_adapter.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql_adapter.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
index bd6cb2d3b8..d4aaf26bf3 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -508,11 +508,10 @@ module ActiveRecord
subselect = Arel::SelectManager.new(select.engine, subsubselect)
subselect.project(Arel::Table.new('__active_record_temp')[update.ast.key.name])
- update.ast.limit = nil
- update.ast.orders = []
- update.wheres = [update.ast.key.in(subselect)]
+ update.where update.ast.key.in(subselect)
else
update.table select.ast.cores.last.source
+ update.wheres = select.constraints
end
end