diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-06-07 20:22:34 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-06-07 20:22:34 -0500 |
commit | e56556e1feadefe795c48b91b484ed04e022cf9b (patch) | |
tree | 6bbee7c8e3ca6e3eed4fa10408e5ee49fe40efda /app/serializers | |
parent | 3ec37e2622f6729300a988c8f58dfb6c2aecb996 (diff) | |
download | gitlab-ce-e56556e1feadefe795c48b91b484ed04e022cf9b.tar.gz |
Use group and project finders instead of direct ActiveRecord relations
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/group_entity.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/serializers/group_entity.rb b/app/serializers/group_entity.rb index 94085ba5afc..b389a63511f 100644 --- a/app/serializers/group_entity.rb +++ b/app/serializers/group_entity.rb @@ -29,11 +29,11 @@ class GroupEntity < Grape::Entity end expose :has_subgroups do |group| - group.children.any? + GroupsFinder.new(request.current_user, parent: group).execute.any? end expose :number_projects_with_delimiter do |group| - number_with_delimiter(group.projects.non_archived.count) + number_with_delimiter(GroupProjectsFinder.new(group: group, current_user: request.current_user).execute.count) end expose :number_users_with_delimiter do |group| |