summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-24 12:31:34 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-24 12:31:34 +0100
commitaf42dd29a0e81d524731f4ce3ced2ed17bac9903 (patch)
tree83cd561b993830b76155519f676558f387f71dee /app
parentdcd2eeb1cfb633f4a28ddd9bc79deac0e3171d3f (diff)
downloadgitlab-ce-af42dd29a0e81d524731f4ce3ced2ed17bac9903.tar.gz
Fix specs for container repository tags
Diffstat (limited to 'app')
-rw-r--r--app/models/container_repository.rb8
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)