Class: UserPlane::FreshValidator
- Inherits:
-
ActiveModel::Validator
- Object
- ActiveModel::Validator
- UserPlane::FreshValidator
- Defined in:
- lib/user_plane/fresh_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate(record) ⇒ Object
5 6 7 |
# File 'lib/user_plane/fresh_validator.rb', line 5 def validate(record) record.errors.add(:created_at, 'has expired') if record.stale? end |