Class: ActiveModel::Validations::EmailValidator
- Inherits:
-
EachValidator
- Object
- EachValidator
- ActiveModel::Validations::EmailValidator
- Defined in:
- lib/validators/validates_email_format_of.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/validators/validates_email_format_of.rb', line 4 def validate_each(record, attribute, value) if value.to_s !~ Validators::EMAIL_FORMAT record.errors.add( attribute, :invalid_email, :message => [:message], :value => value ) end end |