diff options
Diffstat (limited to 'app/models/container_repository.rb')
-rw-r--r-- | app/models/container_repository.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/models/container_repository.rb b/app/models/container_repository.rb index 5663b3db92f..052d93c3bdc 100644 --- a/app/models/container_repository.rb +++ b/app/models/container_repository.rb @@ -45,15 +45,14 @@ class ContainerRepository < ActiveRecord::Base # TODO, specs needed # def has_tags? - tags.any? + tags.to_a.any? end - # TODO, add bang to this method - # - def delete_tags - return unless tags + def delete_tags! + return unless has_tags? + + digests = tags.map { |tag| tag.digest }.to_set - digests = tags.map {|tag| tag.digest }.to_set digests.all? do |digest| client.delete_repository_tag(self.path, digest) end |