Class: EmailAddressValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- EmailAddressValidator
- Defined in:
- lib/validator/email_address_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/validator/email_address_validator.rb', line 5 def validate_each(record, attribute, value) if [:format] raise ArgumentError, "Don't use deprecated :format option. Use :with instead" end rules = Array([:with] || []) rules << build_default_rule if rules.empty? invalidate(record, attribute) unless all_rules_pass?(rules, value) end |