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


43
44
45
46
47
# File 'lib/gitlab/config/entry/validators.rb', line 43

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