Class: Gitlab::Config::Entry::Validators::AllowedValuesValidator

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


54
55
56
57
58
# File 'lib/gitlab/config/entry/validators.rb', line 54

def validate_each(record, attribute, value)
  unless options[:in].include?(value.to_s)
    record.errors.add(attribute, "unknown value: #{value}")
  end
end