Class: BankCard::Validations::ExpirationValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- BankCard::Validations::ExpirationValidator
- Defined in:
- lib/bank_card/validations/expiration_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
4 5 6 |
# File 'lib/bank_card/validations/expiration_validator.rb', line 4 def validate_each(record, attribute, value) record.errors.add(attribute, :is_expired, ) unless value && value.end_of_month >= Date.today end |