Class: Gitlab::Config::Entry::Validators::HashOrIntegerValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Gitlab::Config::Entry::Validators::HashOrIntegerValidator
- Defined in:
- lib/gitlab/config/entry/validators.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
177 178 179 180 181 |
# File 'lib/gitlab/config/entry/validators.rb', line 177 def validate_each(record, attribute, value) unless value.is_a?(Hash) || value.is_a?(Integer) record.errors.add(attribute, 'should be a hash or an integer') end end |