Commit d0effe70 authored by Sean McGivern's avatar Sean McGivern Committed by Heinrich Lee Yu

Replace any_namespace_with_gold? with has_paid_namespace?

parent d580d4e1
...@@ -119,7 +119,7 @@ module EE ...@@ -119,7 +119,7 @@ module EE
end end
def has_no_trial_or_gold_plan?(user) def has_no_trial_or_gold_plan?(user)
return false if user.any_namespace_with_gold? return false if user.has_paid_namespace?
!user.any_namespace_with_trial? !user.any_namespace_with_trial?
end end
......
...@@ -237,14 +237,6 @@ module EE ...@@ -237,14 +237,6 @@ module EE
.any? .any?
end end
def any_namespace_with_gold?
::Namespace
.includes(:plan)
.where("namespaces.id IN (#{namespace_union})") # rubocop:disable GitlabSecurity/SqlInjection
.where.not(plans: { id: nil })
.any?
end
def managed_free_namespaces def managed_free_namespaces
manageable_groups manageable_groups
.left_joins(:gitlab_subscription) .left_joins(:gitlab_subscription)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment