Commit 000af871 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Remove redundant code from container registry classes

parent c753975b
......@@ -34,7 +34,7 @@ module Projects
break if path.has_repository?
ContainerRepository.build_from_path(path).tap do |repository|
repository.save if repository.has_tags?
repository.save! if repository.has_tags?
end
end
end
......
......@@ -28,7 +28,7 @@ class ContainerRepository < ActiveRecord::Base
end
def manifest
@manifest ||= client.repository_tags(self.path)
@manifest ||= client.repository_tags(path)
end
def tags
......@@ -45,7 +45,7 @@ class ContainerRepository < ActiveRecord::Base
end
def has_tags?
tags.to_a.any?
tags.any?
end
def root_repository?
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe ContainerRegistry::Blob do
let(:group) { create(:group, name: 'group') }
let(:project) { create(:project, path: 'test', group: group) }
let(:project) { create(:empty_project, path: 'test', group: group) }
let(:repository) do
create(:container_repository, name: 'image',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment