summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-08-15 19:55:02 +0000
committerDouwe Maan <douwe@gitlab.com>2016-08-15 19:55:02 +0000
commit9ef8de2fb7c0fca8014594c90bc199f11f92402d (patch)
tree10b80653398180b06adeda19fe737ea23d4284cf /lib
parent966b303802e12204f5d32af24b13bd0ceb5342a1 (diff)
parentc42f5f8b56a919473d9adceaf84c9ef77179c5cb (diff)
downloadgitlab-ce-9ef8de2fb7c0fca8014594c90bc199f11f92402d.tar.gz
Merge branch 'fix/export-att-inclusion' into 'master'
Fix attribute inclusion import/export config ignored in some cases In the `import_export.yml` file we define the inclusion of some of the attributes. For some reason, this isn't working in certain cases - very unfortunate this includes `user`. This has been introduced in 8.10.3. Related https://gitlab.com/gitlab-org/gitlab-ce/issues/20802 See merge request !1982
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