Class: Gitlab::Config::Entry::Validators::StringOrNestedArrayOfStringsValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Gitlab::Config::Entry::Validators::StringOrNestedArrayOfStringsValidator
- Includes:
- LegacyValidationHelpers, NestedArrayHelpers
- Defined in:
- lib/gitlab/config/entry/validators.rb
Instance Method Summary collapse
Methods included from NestedArrayHelpers
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
298 299 300 301 302 303 304 |
# File 'lib/gitlab/config/entry/validators.rb', line 298 def validate_each(record, attribute, value) max_level = .fetch(:max_level, 1) unless validate_string(value) || validate_nested_array(value, max_level, &method(:validate_string)) record.errors.add(attribute, "should be a string or a nested array of strings up to #{max_level} levels deep") end end |