Class: Gitlab::Config::Entry::Validators::RequiredKeysValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Gitlab::Config::Entry::Validators::RequiredKeysValidator
- Defined in:
- lib/gitlab/config/entry/validators.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/gitlab/config/entry/validators.rb', line 33 def validate_each(record, attribute, value) present_keys = [:in] - value.try(:keys).to_a if present_keys.any? record.errors.add(attribute, "missing required keys: " + present_keys.join(', ')) end end |