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_setting.rb')
-rw-r--r--app/models/namespace_setting.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/namespace_setting.rb b/app/models/namespace_setting.rb
index aeb4d7a5694..e7f6db38047 100644
--- a/app/models/namespace_setting.rb
+++ b/app/models/namespace_setting.rb
@@ -13,6 +13,7 @@ class NamespaceSetting < ApplicationRecord
enum enabled_git_access_protocol: { all: 0, ssh: 1, http: 2 }, _suffix: true
validates :enabled_git_access_protocol, inclusion: { in: enabled_git_access_protocols.keys }
+ validates :code_suggestions, allow_nil: false, inclusion: { in: [true, false] }
validate :allow_mfa_for_group
validate :allow_resource_access_token_creation_for_group
@@ -63,6 +64,8 @@ class NamespaceSetting < ApplicationRecord
end
def all_ancestors_have_runner_registration_enabled?
+ return false unless Gitlab::CurrentSettings.valid_runner_registrars.include?('group')
+
return true unless namespace.has_parent?
!self.class.where(namespace_id: namespace.ancestors, runner_registration_enabled: false).exists?