diff options
Diffstat (limited to 'app/models/concerns/limitable.rb')
-rw-r--r-- | app/models/concerns/limitable.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/concerns/limitable.rb b/app/models/concerns/limitable.rb index 3cb0bd85936..672bcdbbb1b 100644 --- a/app/models/concerns/limitable.rb +++ b/app/models/concerns/limitable.rb @@ -7,6 +7,7 @@ module Limitable included do class_attribute :limit_scope class_attribute :limit_name + class_attribute :limit_feature_flag self.limit_name = self.name.demodulize.tableize validate :validate_plan_limit_not_exceeded, on: :create @@ -25,6 +26,7 @@ module Limitable def validate_scoped_plan_limit_not_exceeded scope_relation = self.public_send(limit_scope) # rubocop:disable GitlabSecurity/PublicSend return unless scope_relation + return if limit_feature_flag && ::Feature.disabled?(limit_feature_flag, scope_relation, default_enabled: :yaml) relation = self.class.where(limit_scope => scope_relation) limits = scope_relation.actual_limits |