diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-10 14:11:55 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-10 16:54:28 +0200 |
commit | aee5691db3ec411c242e050aaa11ebb44f07f164 (patch) | |
tree | 1bacabb4632b3d90701729d32cbaf41ddeb51c14 /app/finders | |
parent | 3fe7f31ac047e1b9ba3ae53cea17012ce2f7f3e7 (diff) | |
download | gitlab-ce-aee5691db3ec411c242e050aaa11ebb44f07f164.tar.gz |
Don't load unneeded elements in GroupsController#show
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/group_descendants_finder.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/app/finders/group_descendants_finder.rb b/app/finders/group_descendants_finder.rb index 3f231bd8b10..cdd18b89525 100644 --- a/app/finders/group_descendants_finder.rb +++ b/app/finders/group_descendants_finder.rb @@ -19,12 +19,8 @@ class GroupDescendantsFinder Kaminari.paginate_array(all_required_elements, total_count: total_count) end - def subgroup_count - @subgroup_count ||= subgroups.count - end - - def project_count - @project_count ||= projects.count + def has_children? + projects.any? || subgroups.any? end private |