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


418
419
420
421
422
423
424
425
# File 'lib/gitlab/config/entry/validators.rb', line 418

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