diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-05-03 14:49:37 +0200 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-05-17 20:53:16 +0200 |
commit | 34974258bc3f745c86512319231bad47232fe007 (patch) | |
tree | a6b9b7d7a80282f77471302f0970daced62e0455 /lib/gitlab/group_hierarchy.rb | |
parent | ac382b5682dc2d5eea750313c59fb2581af13326 (diff) | |
download | gitlab-ce-34974258bc3f745c86512319231bad47232fe007.tar.gz |
Hide nested group UI/API support for MySQL
This hides/disables some UI elements and API parameters related to
nested groups when MySQL is used, since nested groups are not supported
for MySQL.
Diffstat (limited to 'lib/gitlab/group_hierarchy.rb')
-rw-r--r-- | lib/gitlab/group_hierarchy.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/group_hierarchy.rb b/lib/gitlab/group_hierarchy.rb index 50e057892a6..e9d5d52cabb 100644 --- a/lib/gitlab/group_hierarchy.rb +++ b/lib/gitlab/group_hierarchy.rb @@ -15,12 +15,16 @@ module Gitlab # Returns a relation that includes the base set of groups and all their # ancestors (recursively). def base_and_ancestors + return model.none unless Group.supports_nested_groups? + base_and_ancestors_cte.apply_to(model.all) end # Returns a relation that includes the base set of groups and all their # descendants (recursively). def base_and_descendants + return model.none unless Group.supports_nested_groups? + base_and_descendants_cte.apply_to(model.all) end @@ -45,6 +49,8 @@ module Gitlab # Using this approach allows us to further add criteria to the relation with # Rails thinking it's selecting data the usual way. def all_groups + return base unless Group.supports_nested_groups? + ancestors = base_and_ancestors_cte descendants = base_and_descendants_cte |