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



66
67
68
69
70
# File 'lib/gitlab/config/entry/validators.rb', line 66

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