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



74
75
76
77
78
79
80
# File 'lib/gitlab/config/entry/validators.rb', line 74

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