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:
authorJames Lopez <james@jameslopez.es>2017-09-05 22:06:27 +0300
committerJames Lopez <james@jameslopez.es>2017-09-05 22:06:27 +0300
commit104f221b601621cdfdd083f82780188c84190a1c (patch)
tree0973247abd5e9cbfa1c0f1d091d7a26f3c808838 /lib
parent1d57ae8f8410e814e79ea0a6bbb9c714aad37e4f (diff)
fix specs
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/import_export/project_tree_restorer.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb
index 7f24eae7ef8..d365e9ad40b 100644
--- a/lib/gitlab/import_export/project_tree_restorer.rb
+++ b/lib/gitlab/import_export/project_tree_restorer.rb
@@ -72,7 +72,7 @@ module Gitlab
@saved << restored_project.append_or_update_attribute(relation_key, relation_hash)
# Restore the project again, extra query but let us skip holding the AR objects in memory
- @restored_project = Project.find_by_id(@project_id)
+ @restored_project = Project.find(@project_id)
end
def default_relation_list
@@ -153,14 +153,12 @@ module Gitlab
end
def create_relation(relation, relation_hash_list)
- relation_type = relation.to_sym
-
relation_array = [relation_hash_list].flatten.map do |relation_hash|
- Gitlab::ImportExport::RelationFactory.create(relation_sym: relation_type,
- relation_hash: parsed_relation_hash(relation_hash, relation_type),
+ Gitlab::ImportExport::RelationFactory.create(relation_sym: relation.to_sym,
+ relation_hash: parsed_relation_hash(relation_hash, relation.to_sym),
members_mapper: members_mapper,
user: @user,
- project: restored_project)
+ project: @restored_project)
end.compact
relation_hash_list.is_a?(Array) ? relation_array : relation_array.first