Class: Gitlab::Config::Entry::Validators::ArrayOfIntegersOrIntegerValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Includes:
LegacyValidationHelpers
Defined in:
lib/gitlab/config/entry/validators.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



221
222
223
224
225
# File 'lib/gitlab/config/entry/validators.rb', line 221

def validate_each(record, attribute, value)
  unless validate_integer(value) || validate_array_of_integers(value)
    record.errors.add(attribute, 'should be an array of integers or an integer')
  end
end