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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 22:00:14 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 22:00:14 +0300
commit05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch)
tree11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /lib/gitlab/config
parentec73467c23693d0db63a797d10194da9e72a74af (diff)
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'lib/gitlab/config')
-rw-r--r--lib/gitlab/config/entry/attributable.rb4
-rw-r--r--lib/gitlab/config/entry/validators.rb1
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab/config/entry/attributable.rb b/lib/gitlab/config/entry/attributable.rb
index c8ad2521574..2e5b226678a 100644
--- a/lib/gitlab/config/entry/attributable.rb
+++ b/lib/gitlab/config/entry/attributable.rb
@@ -24,6 +24,10 @@ module Gitlab
define_method("has_#{attribute_method}?") do
config.is_a?(Hash) && config.key?(attribute)
end
+
+ define_method("has_#{attribute_method}_value?") do
+ config.is_a?(Hash) && config.key?(attribute) && !config[attribute].nil?
+ end
end
end
end
diff --git a/lib/gitlab/config/entry/validators.rb b/lib/gitlab/config/entry/validators.rb
index b88a6766d92..9e6a3d86e92 100644
--- a/lib/gitlab/config/entry/validators.rb
+++ b/lib/gitlab/config/entry/validators.rb
@@ -17,6 +17,7 @@ module Gitlab
class DisallowedKeysValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
+ value = value.try(:compact) if options[:ignore_nil]
present_keys = value.try(:keys).to_a & options[:in]
if present_keys.any?