summaryrefslogtreecommitdiff
path: root/app/validators/email_validator.rb
blob: 9459edb7515f3a6332ac29685764d4e8f20d961f (plain)
1
2
3
4
5
6
7
# 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