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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 18:06:24 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 18:06:24 +0300
commit88542a5e9613c8442a982e65ad5cf13eb33bc541 (patch)
tree11a65d86e623b443b8a2976cc93cff360e2da8a2 /lib/gitlab/import_export
parentb570d73ecd31e2ca9cf8c2f1adb056edf2869477 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/import_export')
-rw-r--r--lib/gitlab/import_export/relation_factory.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb
index ae6b3c161ce..5d907300d68 100644
--- a/lib/gitlab/import_export/relation_factory.rb
+++ b/lib/gitlab/import_export/relation_factory.rb
@@ -327,7 +327,12 @@ module Gitlab
end
def find_or_create_object!
- return relation_class.find_or_create_by(project_id: @project.id) if UNIQUE_RELATIONS.include?(@relation_name)
+ if UNIQUE_RELATIONS.include?(@relation_name)
+ unique_relation_object = relation_class.find_or_create_by(project_id: @project.id)
+ unique_relation_object.assign_attributes(parsed_relation_hash)
+
+ return unique_relation_object
+ end
# Can't use IDs as validation exists calling `group` or `project` attributes
finder_hash = parsed_relation_hash.tap do |hash|