Commit 67e90a12 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Make fabrication of default config entry more readable

parent 8b185467
...@@ -150,7 +150,7 @@ module Gitlab ...@@ -150,7 +150,7 @@ module Gitlab
stage: stage_value, stage: stage_value,
cache: cache_value, cache: cache_value,
only: only_value, only: only_value,
except: except_value.to_h, except: except_value,
variables: variables_defined? ? variables_value : nil, variables: variables_defined? ? variables_value : nil,
environment: environment_defined? ? environment_value : nil, environment: environment_defined? ? environment_value : nil,
environment_name: environment_defined? ? environment_value[:name] : nil, environment_name: environment_defined? ? environment_value[:name] : nil,
......
...@@ -53,10 +53,12 @@ module Gitlab ...@@ -53,10 +53,12 @@ module Gitlab
# If entry has a default value we fabricate concrete node # If entry has a default value we fabricate concrete node
# with default value. # with default value.
# #
if @entry.default(@attributes).nil? @entry.default(@attributes).yield_self do |default|
fabricate(Entry::Undefined) if default.nil?
else fabricate(Entry::Undefined)
fabricate(@entry, @entry.default(@attributes)) else
fabricate(@entry, default)
end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment