Skip to content

Commit

Permalink
Add email validation errors via add (lynndylanhurley#1445)
Browse files Browse the repository at this point in the history
  • Loading branch information
artplan1 authored Dec 8, 2020
1 parent 72ccd90 commit c922580
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/validators/devise_token_auth_email_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c922580

Please sign in to comment.