Class: ActiveModel::Validations::FutureDateValidator
- Inherits:
-
EachValidator
- Object
- EachValidator
- ActiveModel::Validations::FutureDateValidator
- Defined in:
- lib/format_validator/future_date_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(object, attribute, value) ⇒ Object
4 5 6 7 8 |
# File 'lib/format_validator/future_date_validator.rb', line 4 def validate_each(object, attribute, value) if value.to_i <= Time.now.to_i object.errors[attribute] << ([:message] || 'must be in the future') end end |