diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-03-24 12:31:34 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-03-24 12:31:34 +0100 |
commit | af42dd29a0e81d524731f4ce3ced2ed17bac9903 (patch) | |
tree | 83cd561b993830b76155519f676558f387f71dee /app | |
parent | dcd2eeb1cfb633f4a28ddd9bc79deac0e3171d3f (diff) | |
download | gitlab-ce-af42dd29a0e81d524731f4ce3ced2ed17bac9903.tar.gz |
Fix specs for container repository tags
Diffstat (limited to 'app')
-rw-r--r-- | app/models/container_repository.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/container_repository.rb b/app/models/container_repository.rb index 2f0fd3014a8..e5076f30c8e 100644 --- a/app/models/container_repository.rb +++ b/app/models/container_repository.rb @@ -1,8 +1,10 @@ class ContainerRepository < ActiveRecord::Base belongs_to :project - delegate :client, to: :registry + validates :manifest, presence: true - validates :name, presence: true + validates :name, length: { minimum: 0, allow_nil: false } + + delegate :client, to: :registry before_destroy :delete_tags def registry @@ -17,7 +19,7 @@ class ContainerRepository < ActiveRecord::Base end def path - @path ||= "#{project.full_path}/#{name}" + @path ||= [project.full_path, name].select(&:present?).join('/') end def tag(tag) |