Class: Gitlab::Config::Entry::Validators::ArrayOrStringValidator

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

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



135
136
137
138
139
# File 'lib/gitlab/config/entry/validators.rb', line 135

def validate_each(record, attribute, value)
  unless value.is_a?(Array) || value.is_a?(String)
    record.errors.add(attribute, 'should be an array or a string')
  end
end