Class: Gitlab::Config::Entry::Validators::DurationValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Gitlab::Config::Entry::Validators::DurationValidator
- Includes:
- LegacyValidationHelpers
- Defined in:
- lib/gitlab/config/entry/validators.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/gitlab/config/entry/validators.rb', line 155 def validate_each(record, attribute, value) unless validate_duration(value, [:parser]) record.errors.add(attribute, 'should be a duration') end if [:limit] unless validate_duration_limit(value, [:limit], [:parser]) record.errors.add(attribute, 'should not exceed the limit') end end end |