Class: Gitlab::Config::Entry::Validators::ArrayOfStringsValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Gitlab::Config::Entry::Validators::ArrayOfStringsValidator
- Includes:
- LegacyValidationHelpers
- Defined in:
- lib/gitlab/config/entry/validators.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/gitlab/config/entry/validators.rb', line 85 def validate_each(record, attribute, value) valid = validate_array_of_strings(value) record.errors.add(attribute, 'should be an array of strings') unless valid if valid && [:with] unless value.all? { |v| v =~ [:with] } = [:message] || 'contains elements that do not match the format' record.errors.add(attribute, ) end end end |