aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/crud.rb1
-rw-r--r--lib/arel/visitors/to_sql.rb12
2 files changed, 2 insertions, 11 deletions
diff --git a/lib/arel/crud.rb b/lib/arel/crud.rb
index 6b3a776c6f..ef14439a1f 100644
--- a/lib/arel/crud.rb
+++ b/lib/arel/crud.rb
@@ -10,6 +10,7 @@ module Arel
else
relation = values.first.first.relation
end
+ um.key= relation.primary_key
um.table relation
um.set values
um.take @ast.limit.expr if @ast.limit
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb
index b61d5f7acd..1d8cd35806 100644
--- a/lib/arel/visitors/to_sql.rb
+++ b/lib/arel/visitors/to_sql.rb
@@ -85,17 +85,7 @@ module Arel
if o.orders.empty? && o.limit.nil?
wheres = o.wheres
else
- key = o.key
- unless key
- warn(<<-eowarn) if $VERBOSE
-(#{caller.first}) Using UpdateManager without setting UpdateManager#key is
-deprecated and support will be removed in Arel 4.0.0. Please set the primary
-key on UpdateManager using UpdateManager#key= '#{key.inspect}'
- eowarn
- key = o.relation.primary_key
- end
-
- wheres = [Nodes::In.new(key, [build_subselect(key, o)])]
+ wheres = [Nodes::In.new(o.key, [build_subselect(o.key, o)])]
end
[