Skip to content

Commit c922580

Browse files
authored
Add email validation errors via add (#1445)
1 parent 72ccd90 commit c922580

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/validators/devise_token_auth_email_validator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class DeviseTokenAuthEmailValidator < ActiveModel::EachValidator
44
def validate_each(record, attribute, value)
55
unless value =~ /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
6-
record.errors[attribute] << email_invalid_message
6+
record.errors.add(attribute, email_invalid_message)
77
end
88
end
99

0 commit comments

Comments
 (0)