diff options
author | James Lopez <james@jameslopez.es> | 2016-08-11 11:03:26 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-08-11 12:49:07 +0200 |
commit | efab1677a7a2959a28a09393a2b6519072005534 (patch) | |
tree | 5e8d497539f68f56bde4804ce46d910e2882ef2d /lib | |
parent | 34d5426f0e17a9d0a2d2330b472114e7e457ae05 (diff) | |
download | gitlab-ce-efab1677a7a2959a28a09393a2b6519072005534.tar.gz |
Fix attribute inclusion in import/export config ignored in some cases
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/import_export/json_hash_builder.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/gitlab/import_export/json_hash_builder.rb b/lib/gitlab/import_export/json_hash_builder.rb index 008300bde45..b7db0e7a06a 100644 --- a/lib/gitlab/import_export/json_hash_builder.rb +++ b/lib/gitlab/import_export/json_hash_builder.rb @@ -57,10 +57,7 @@ module Gitlab # +value+ existing model to be included in the hash # +json_config_hash+ the original hash containing the root model def create_model_value(current_key, value, json_config_hash) - parsed_hash = { include: value } - parse_hash(value, parsed_hash) - - json_config_hash[current_key] = parsed_hash + json_config_hash[current_key] = parse_hash(value, { include: value }) end # Calls attributes finder to parse the hash and add any attributes to it @@ -69,8 +66,8 @@ module Gitlab # +parsed_hash+ the original hash def parse_hash(value, parsed_hash) @attributes_finder.parse(value) do |hash| - parsed_hash = { include: hash_or_merge(value, hash) } - end + { include: hash_or_merge(value, hash) } + end || parsed_hash end # Adds new model configuration to an existing hash with key +current_key+ |