Class: Gitlab::Config::Entry::Validators::KeyValidator

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


140
141
142
143
144
145
146
# File 'lib/gitlab/config/entry/validators.rb', line 140

def validate_each(record, attribute, value)
  if validate_string(value)
    validate_path(record, attribute, value)
  else
    record.errors.add(attribute, 'should be a string or symbol')
  end
end