diff --git a/app/validators/devise_token_auth_email_validator.rb b/app/validators/devise_token_auth_email_validator.rb index 3637cf688..c5e1db846 100644 --- a/app/validators/devise_token_auth_email_validator.rb +++ b/app/validators/devise_token_auth_email_validator.rb @@ -3,7 +3,7 @@ class DeviseTokenAuthEmailValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) unless value =~ /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i - record.errors[attribute] << email_invalid_message + record.errors.add(attribute, email_invalid_message) end end