Commit 668e6649 authored by Markus Koller's avatar Markus Koller

Merge branch 'remove-unused-namespace-all-pipelines' into 'master'

Remove unused Namespace#all_pipelines

See merge request gitlab-org/gitlab!62266
parents 06de4db1 f1897445
......@@ -275,12 +275,6 @@ class Namespace < ApplicationRecord
Project.where(namespace: namespace)
end
# Includes pipelines from this namespace and pipelines from all subgroups
# that belongs to this namespace
def all_pipelines
Ci::Pipeline.where(project: all_projects)
end
def has_parent?
parent_id.present? || parent.present?
end
......
......@@ -1042,17 +1042,6 @@ RSpec.describe Namespace do
end
end
describe '#all_pipelines' do
let(:group) { create(:group) }
let(:child) { create(:group, parent: group) }
let!(:project1) { create(:project_empty_repo, namespace: group) }
let!(:project2) { create(:project_empty_repo, namespace: child) }
let!(:pipeline1) { create(:ci_empty_pipeline, project: project1) }
let!(:pipeline2) { create(:ci_empty_pipeline, project: project2) }
it { expect(group.all_pipelines.to_a).to match_array([pipeline1, pipeline2]) }
end
describe '#share_with_group_lock with subgroups' do
context 'when creating a subgroup' do
let(:subgroup) { create(:group, parent: root_group )}
......
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