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
path: root/lib
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2016-08-16 20:24:03 +0300
committerRuben Davila <rdavila84@gmail.com>2016-08-16 20:24:03 +0300
commit7f853e2245eff92c037af5e007163d3e9631888d (patch)
treef235958bee27285654db1d5e71c30a500bb08c6a /lib
parent07d5759408000ff46088ad886df149e21faf676f (diff)
parent9ef8de2fb7c0fca8014594c90bc199f11f92402d (diff)
Merge remote-tracking branch 'dev/master'
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