diff options
Diffstat (limited to 'lib/gitlab/config/entry/configurable.rb')
-rw-r--r-- | lib/gitlab/config/entry/configurable.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/gitlab/config/entry/configurable.rb b/lib/gitlab/config/entry/configurable.rb index bda84dc2cff..d5a093a469a 100644 --- a/lib/gitlab/config/entry/configurable.rb +++ b/lib/gitlab/config/entry/configurable.rb @@ -25,7 +25,6 @@ module Gitlab end end - # rubocop: disable CodeReuse/ActiveRecord def compose!(deps = nil) return unless valid? @@ -35,11 +34,7 @@ module Gitlab # we can end with different config types like String next unless config.is_a?(Hash) - factory - .value(config[key]) - .with(key: key, parent: self) - - entries[key] = factory.create! + entry_create!(key, config[key]) end yield if block_given? @@ -49,6 +44,16 @@ module Gitlab end end end + + # rubocop: disable CodeReuse/ActiveRecord + def entry_create!(key, value) + factory = self.class + .nodes[key] + .value(value) + .with(key: key, parent: self) + + entries[key] = factory.create! + end # rubocop: enable CodeReuse/ActiveRecord def skip_config_hash_validation? |