Class: Spina::Admin::Conferences::FinishTimeValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Spina::Admin::Conferences::FinishTimeValidator
- Defined in:
- app/validators/spina/admin/conferences/finish_time_validator.rb
Overview
Validator for times which should occur after a start_time.
Instance Method Summary collapse
-
#validate_each(record, attribute, value) ⇒ Object
Performs validation on the supplied record.
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
Performs validation on the supplied record.
12 13 14 15 16 |
# File 'app/validators/spina/admin/conferences/finish_time_validator.rb', line 12 def validate_each(record, attribute, value) return if value.blank? || record.start_time.blank? || value >= record.start_time record.errors.add(attribute, :before_start_time) end |