Class: Gitlab::Config::Entry::Validators::ServicesWithPortsAliasUniqueValidator

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



434
435
436
437
438
439
440
441
# File 'lib/gitlab/config/entry/validators.rb', line 434

def validate_each(record, attribute, value)
  current_aliases = aliases(value)
  return if current_aliases.empty?

  unless aliases_unique?(current_aliases)
    record.errors.add(:config, 'alias must be unique in services with ports')
  end
end