2018-11-08 19:23:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
class EmailValidator < ActiveModel::EachValidator
|
|
|
|
def validate_each(record, attribute, value)
|
2016-04-02 18:10:28 +05:30
|
|
|
record.errors.add(attribute, :invalid) unless value =~ Devise.email_regexp
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|