From c92258038c05fcc8f6a0374ccce2e63b9f8d5312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=AEArtem=20Kozaev?= Date: Tue, 8 Dec 2020 22:58:00 +0300 Subject: [PATCH] Add email validation errors via add (#1445) --- 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