Skip to content

Commit

Permalink
Fix method name in update! error message [ci skip]
Browse files Browse the repository at this point in the history
Followup to 562ec58.
  • Loading branch information
eugeneius committed Jun 10, 2021
1 parent f10d814 commit fcc83e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/persistence.rb
Expand Up @@ -337,7 +337,7 @@ def update!(id = :all, attributes)
if id.is_a?(Array)
if id.any?(ActiveRecord::Base)
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)`."
end
id.map { |one_id| find(one_id) }.each_with_index { |object, idx|
Expand All @@ -348,7 +348,7 @@ def update!(id = :all, attributes)
else
if ActiveRecord::Base === id
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`."
end
object = find(id)
Expand Down

0 comments on commit fcc83e4

Please sign in to comment.