From 5e07a35299ffdee730553b463da4995d717dfebd Mon Sep 17 00:00:00 2001 From: Drew Blessing Date: Wed, 18 Dec 2019 14:30:06 -0600 Subject: [PATCH] Change namespace billable_members_count to include all descendants Currently billable_members_count only includes members in the current namespace plus descendant namespaces. It does not include members of projects within the group hierarchy. This change includes direct and indirect users of any and all groups and projects within the hierarchy, which is more indicative of total billable users. --- ee/app/models/ee/group.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/app/models/ee/group.rb b/ee/app/models/ee/group.rb index 62a2f594c36350..282aefdb2ac7e3 100644 --- a/ee/app/models/ee/group.rb +++ b/ee/app/models/ee/group.rb @@ -258,9 +258,9 @@ def checked_file_template_project(*args, &blk) override :billable_members_count def billable_members_count(requested_hosted_plan = nil) if [actual_plan_name, requested_hosted_plan].include?(Plan::GOLD) - users_with_descendants.excluding_guests.count + direct_and_indirect_users.excluding_guests.count else - users_with_descendants.count + direct_and_indirect_users.count end end -- GitLab