Resolve "Fix showing only free namespaces when applying licenses"
What does this MR do?
Fix the User#managed_free_namespaces
scope to not rely on the namespaces.plan_id
column, since it is not used.
Instead, join with the gitlab_subscriptions
and plans
tables.
This MR also moves the with_counts(archived: false)
method to the SubscriptionsHelper
(where it is used in order to prevent n+1 queries when collecting member_count
s), because member counts are not needed in the SubscriptionsController
, where the scope is also used.
Closes #208894 (closed)
Edited by Alex Buijs