From 4e9c06658829165351e1e6b11cd4a14f76b0fc84 Mon Sep 17 00:00:00 2001 From: Artem Kozaev Date: Fri, 4 Dec 2020 14:07:25 +0300 Subject: [PATCH] Add email validation errors via add --- app/validators/devise_token_auth_email_validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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