Class: Gitlab::Config::Entry::Validators::AllowedArrayValuesValidator

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


62
63
64
65
66
67
68
# File 'lib/gitlab/config/entry/validators.rb', line 62

def validate_each(record, attribute, value)
  unknown_values = value - options[:in]
  unless unknown_values.empty?
    record.errors.add(attribute, "contains unknown values: " +
                                  unknown_values.join(', '))
  end
end