summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorVictor Zagorodny <vzagorodny@gitlab.com>2019-08-28 14:26:42 +0000
committerKamil TrzciƄski <ayufan@ayufan.eu>2019-08-28 14:26:42 +0000
commite4fbd94cf5eba0b103bd97627d822f2014dfe474 (patch)
tree4d3718b36b12a3f7ac08a8b7c9e3f6a337c66f15 /app/finders
parent8c262bf7d0992dcdc533d8d7c866adb9dc43467a (diff)
downloadgitlab-ce-e4fbd94cf5eba0b103bd97627d822f2014dfe474.tar.gz
Update CE files for GSD projects filter
A new param with_security_reports was added to GET /groups/:id/projects API and the code to support this logic in GroupProjectsFinder and Project model. Also, a DB index was added to ci_job_artifacts table to speed up the search of security reports artifacts for projects
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/group_projects_finder.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/finders/group_projects_finder.rb b/app/finders/group_projects_finder.rb
index 4155b6af8da..5e0dbbfca2e 100644
--- a/app/finders/group_projects_finder.rb
+++ b/app/finders/group_projects_finder.rb
@@ -23,8 +23,12 @@ class GroupProjectsFinder < ProjectsFinder
attr_reader :group, :options
def initialize(group:, params: {}, options: {}, current_user: nil, project_ids_relation: nil)
- super(params: params, current_user: current_user, project_ids_relation: project_ids_relation)
- @group = group
+ super(
+ params: params,
+ current_user: current_user,
+ project_ids_relation: project_ids_relation
+ )
+ @group = group
@options = options
end
@@ -84,15 +88,13 @@ class GroupProjectsFinder < ProjectsFinder
options.fetch(:include_subgroups, false)
end
- # rubocop: disable CodeReuse/ActiveRecord
def owned_projects
if include_subgroups?
- Project.where(namespace_id: group.self_and_descendants.select(:id))
+ Project.for_group_and_its_subgroups(group)
else
group.projects
end
end
- # rubocop: enable CodeReuse/ActiveRecord
def shared_projects
group.shared_projects