diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-03 12:51:13 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-03 12:51:13 +0300 |
commit | 6fefa794304a6233368b592422ea0fb71a2700f0 (patch) | |
tree | df4483231f278753e380778695e82ffe25e687a2 /app/models | |
parent | e10dae3e3c2a5fb6077244c72e44c912b7281349 (diff) |
Validate uniqueness of container repository name
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/container_repository.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/container_repository.rb b/app/models/container_repository.rb index ab04258ab8d..0cf781799e9 100644 --- a/app/models/container_repository.rb +++ b/app/models/container_repository.rb @@ -2,6 +2,7 @@ class ContainerRepository < ActiveRecord::Base belongs_to :project validates :name, length: { minimum: 0, allow_nil: false } + validates :name, uniqueness: { scope: :project_id } delegate :client, to: :registry |