Commit f1897445 authored by Dylan Griffith's avatar Dylan Griffith

Remove unused Namespace#all_pipelines

This is related to some work where we are looking into moving some
tables to a separate logical database. This query may be a little tricky
to do if we move `ci_pipelines` to a separate logical database.

However, it appears this method is unused anyway so we may as well just
remove it for now.
parent a1baedce
......@@ -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