diff options
author | Victor Zagorodny <vzagorodny@gitlab.com> | 2019-08-28 14:26:42 +0000 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2019-08-28 14:26:42 +0000 |
commit | e4fbd94cf5eba0b103bd97627d822f2014dfe474 (patch) | |
tree | 4d3718b36b12a3f7ac08a8b7c9e3f6a337c66f15 /app/finders | |
parent | 8c262bf7d0992dcdc533d8d7c866adb9dc43467a (diff) | |
download | gitlab-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.rb | 12 |
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 |