Skip to content

Commit

Permalink
Avoid deprecated method to add error
Browse files Browse the repository at this point in the history
Calling `<<` to an ActiveModel::Errors message array in order to add an error is deprecated. Please call `ActiveModel::Errors#add` instead.
  • Loading branch information
joergschiller committed Dec 11, 2020
1 parent 30f82f1 commit f504fc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paranoia.rb
Expand Up @@ -316,7 +316,7 @@ class AssociationNotSoftDestroyedValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
# if association is soft destroyed, add an error
if value.present? && value.paranoia_destroyed?
record.errors[attribute] << 'has been soft-deleted'
record.errors.add(attribute, 'has been soft-deleted')
end
end
end
Expand Down

0 comments on commit f504fc9

Please sign in to comment.