summaryrefslogtreecommitdiff
path: root/lib/container_registry/path.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/container_registry/path.rb')
-rw-r--r--lib/container_registry/path.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/container_registry/path.rb b/lib/container_registry/path.rb
index 61849a40383..1ab14c1c155 100644
--- a/lib/container_registry/path.rb
+++ b/lib/container_registry/path.rb
@@ -28,6 +28,7 @@ module ContainerRegistry
@components ||= @path.split('/')
end
+ # rubocop: disable CodeReuse/ActiveRecord
def nodes
raise InvalidRegistryPathError unless valid?
@@ -35,17 +36,20 @@ module ContainerRegistry
components.take(length).join('/')
end
end
+ # rubocop: enable CodeReuse/ActiveRecord
def has_project?
repository_project.present?
end
+ # rubocop: disable CodeReuse/ActiveRecord
def has_repository?
return false unless has_project?
repository_project.container_repositories
.where(name: repository_name).any?
end
+ # rubocop: enable CodeReuse/ActiveRecord
def root_repository?
@path == project_path