1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix method name in update! error message [ci skip]

Followup to 562ec582f7.
This commit is contained in:
Eugene Kenny 2021-06-10 08:30:16 +01:00
parent f10d814140
commit fcc83e4738

View file

@ -337,7 +337,7 @@ module ActiveRecord
if id.is_a?(Array) if id.is_a?(Array)
if id.any?(ActiveRecord::Base) if id.any?(ActiveRecord::Base)
raise ArgumentError, raise ArgumentError,
"You are passing an array of ActiveRecord::Base instances to `update`. " \ "You are passing an array of ActiveRecord::Base instances to `update!`. " \
"Please pass the ids of the objects by calling `pluck(:id)` or `map(&:id)`." "Please pass the ids of the objects by calling `pluck(:id)` or `map(&:id)`."
end end
id.map { |one_id| find(one_id) }.each_with_index { |object, idx| id.map { |one_id| find(one_id) }.each_with_index { |object, idx|
@ -348,7 +348,7 @@ module ActiveRecord
else else
if ActiveRecord::Base === id if ActiveRecord::Base === id
raise ArgumentError, raise ArgumentError,
"You are passing an instance of ActiveRecord::Base to `update`. " \ "You are passing an instance of ActiveRecord::Base to `update!`. " \
"Please pass the id of the object by calling `.id`." "Please pass the id of the object by calling `.id`."
end end
object = find(id) object = find(id)