Method: FutureValidator#validate_each
- Defined in:
- app/validators/future_validator.rb
#validate_each(record, attribute, _value) ⇒ Object
2 3 4 5 6 |
# File 'app/validators/future_validator.rb', line 2 def validate_each(record, attribute, _value) if record[attribute] < Time.now record.errors.add(attribute, :invalid, message: ([:message] || "must be in the future.")) end end |