2018-06-27 12:20:23 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-02-09 11:59:47 -05:00
|
|
|
class EmailValidator < ActiveModel::EachValidator
|
|
|
|
def validate_each(record, attribute, value)
|
|
|
|
record.errors.add(attribute, :invalid) unless value =~ Devise.email_regexp
|
|
|
|
end
|
|
|
|
end
|