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 |
# File 'lib/validator/email_address_validator.rb', line 5 def validate_each(record, attribute, value) rules = Array([:with] || []) if rules.empty? # We are using the old syntax, assume regular expressions rules = [build_rule_from_format([:format])] end invalidate(record, attribute) unless all_rules_pass?(rules, value) end |