summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-08-16 23:51:22 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-08-16 23:51:22 +0530
commitd9efc7d9e6eb0b8247226c2fe2e929598f297056 (patch)
tree4b7347e8c462d65b12c87a2292d7879ee44fbaf2 /lib
parent8c101fc313208b2256f9b9a2d596a0b398f173e0 (diff)
parent7f853e2245eff92c037af5e007163d3e9631888d (diff)
downloadgitlab-ce-d9efc7d9e6eb0b8247226c2fe2e929598f297056.tar.gz
Merge remote-tracking branch 'origin/master' into ee-581-backport-changesee-581-backport-changes
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/import_export/json_hash_builder.rb9
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..0cc10f40087 100644
--- a/lib/gitlab/import_export/json_hash_builder.rb
+++ b/lib/gitlab/import_export/json_hash_builder.rb
@@ -57,19 +57,16 @@ 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
#
# +value+ existing model to be included in the hash
# +parsed_hash+ the original hash
- def parse_hash(value, parsed_hash)
+ def parse_hash(value)
@attributes_finder.parse(value) do |hash|
- parsed_hash = { include: hash_or_merge(value, hash) }
+ { include: hash_or_merge(value, hash) }
end
end