summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-08-11 21:42:34 +0200
committerJames Lopez <james@jameslopez.es>2016-08-11 21:42:34 +0200
commitc42f5f8b56a919473d9adceaf84c9ef77179c5cb (patch)
treee8471a4c02b7f1f4819b01f617cd87cdd1f39cca
parentefab1677a7a2959a28a09393a2b6519072005534 (diff)
downloadgitlab-ce-c42f5f8b56a919473d9adceaf84c9ef77179c5cb.tar.gz
refactor parse_hash based on feedback
-rw-r--r--lib/gitlab/import_export/json_hash_builder.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/import_export/json_hash_builder.rb b/lib/gitlab/import_export/json_hash_builder.rb
index b7db0e7a06a..0cc10f40087 100644
--- a/lib/gitlab/import_export/json_hash_builder.rb
+++ b/lib/gitlab/import_export/json_hash_builder.rb
@@ -57,17 +57,17 @@ 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)
- json_config_hash[current_key] = parse_hash(value, { include: value })
+ 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|
{ include: hash_or_merge(value, hash) }
- end || parsed_hash
+ end
end
# Adds new model configuration to an existing hash with key +current_key+