diff options
author | James Lopez <james@jameslopez.es> | 2016-08-12 12:04:33 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-09-27 15:48:10 +0200 |
commit | 4c480be39b0862f41043e94a6dc5b943b6f8e8f0 (patch) | |
tree | 7c3f18944c33d0bc53a0bae99d92adc8fce5ab40 /lib/gitlab/import_export/project_tree_restorer.rb | |
parent | 0ee03af814c34d9c1cad8535b46ad65e96426c8e (diff) | |
download | gitlab-ce-4c480be39b0862f41043e94a6dc5b943b6f8e8f0.tar.gz |
Prevent claiming associated model IDs via import and added relevant specs
Diffstat (limited to 'lib/gitlab/import_export/project_tree_restorer.rb')
-rw-r--r-- | lib/gitlab/import_export/project_tree_restorer.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb index c7b3551b84c..35adcd8f0da 100644 --- a/lib/gitlab/import_export/project_tree_restorer.rb +++ b/lib/gitlab/import_export/project_tree_restorer.rb @@ -104,9 +104,10 @@ module Gitlab def create_relation(relation, relation_hash_list) relation_array = [relation_hash_list].flatten.map do |relation_hash| Gitlab::ImportExport::RelationFactory.create(relation_sym: relation.to_sym, - relation_hash: relation_hash.merge('project_id' => restored_project.id), + relation_hash: relation_hash, members_mapper: members_mapper, - user: @user) + user: @user, + project_id: restored_project.id) end relation_hash_list.is_a?(Array) ? relation_array : relation_array.first |