Class: EmailValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- EmailValidator
- Includes:
- EmailRegexp
- Defined in:
- lib/validates/email_validator.rb
Instance Method Summary collapse
Methods included from EmailRegexp
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
4 5 6 7 8 |
# File 'lib/validates/email_validator.rb', line 4 def validate_each(record, attribute, value) unless regexp_compare(value) record.errors.add(attribute, :email, .merge(:value => value)) end end |