Class: ActiveModel::Validations::PostcodeValidator
- Inherits:
-
EachValidator
- Object
- EachValidator
- ActiveModel::Validations::PostcodeValidator
- Defined in:
- lib/validates_for_australia/postcode_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
6 7 8 |
# File 'lib/validates_for_australia/postcode_validator.rb', line 6 def validate_each(record, attribute, value) record.errors[attribute] << "is not valid" unless valid_australian_postcode?(value) end |