Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarka Kadlecová <jarka@gitlab.com>2018-01-24 09:06:24 +0300
committerJarka Kadlecová <jarka@gitlab.com>2018-02-01 09:04:37 +0300
commit7f0ebeff1affcd4f5155790cc5a5884b052695af (patch)
treea5ecccef5c658686b022a284087e71ba541e923f /app/finders/group_projects_finder.rb
parent8f5d1d1371b47ab810a9e5ddff483f669d149363 (diff)
Include subgroup issuables on the group page
Diffstat (limited to 'app/finders/group_projects_finder.rb')
-rw-r--r--app/finders/group_projects_finder.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/finders/group_projects_finder.rb b/app/finders/group_projects_finder.rb
index f2d3b90b8e2..f73cf8adb4d 100644
--- a/app/finders/group_projects_finder.rb
+++ b/app/finders/group_projects_finder.rb
@@ -87,8 +87,17 @@ class GroupProjectsFinder < ProjectsFinder
options.fetch(:only_shared, false)
end
+ # subgroups are supported only for owned projects not for shared
+ def include_subgroups?
+ options.fetch(:include_subgroups, false)
+ end
+
def owned_projects
- group.projects
+ if include_subgroups?
+ Project.where(namespace_id: group.self_and_descendants.select(:id))
+ else
+ group.projects
+ end
end
def shared_projects