Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 9e7589a1f18..d8a305b4cf3 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -346,6 +346,21 @@ class Namespace < ApplicationRecord
.try(name)
end
+ def actual_plan
+ Plan.default
+ end
+
+ def actual_limits
+ # We default to PlanLimits.new otherwise a lot of specs would fail
+ # On production each plan should already have associated limits record
+ # https://gitlab.com/gitlab-org/gitlab/issues/36037
+ actual_plan.limits || PlanLimits.new
+ end
+
+ def actual_plan_name
+ actual_plan.name
+ end
+
private
def all_projects_with_pages