gitlab-org--gitlab-foss/app/validators/email_validator.rb
2018-06-27 09:48:37 -07:00

7 lines
216 B
Ruby

# frozen_string_literal: true
class EmailValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
record.errors.add(attribute, :invalid) unless value =~ Devise.email_regexp
end
end