debian-mirror-gitlab/app/validators/email_validator.rb

8 lines
216 B
Ruby
Raw Normal View History

2019-05-30 16:15:17 +05:30
# 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