diff options
author | micael.bergeron <micaelbergeron@gmail.com> | 2017-10-05 19:03:30 +0300 |
---|---|---|
committer | micael.bergeron <micaelbergeron@gmail.com> | 2017-10-05 19:05:55 +0300 |
commit | a8d9dbc1a64fd84bebf59a358e0f1aaa2c1cac98 (patch) | |
tree | 26ec0f8e3dd89d62c587d9114f015195bf03388a /lib/gitlab/import_export | |
parent | 09a733bac33195ef2693b17f1d3277dd26dc7777 (diff) |
fix the project import when an issue has a group milestone
Diffstat (limited to 'lib/gitlab/import_export')
-rw-r--r-- | lib/gitlab/import_export/relation_factory.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb index 380b336395d..b936873f1d7 100644 --- a/lib/gitlab/import_export/relation_factory.rb +++ b/lib/gitlab/import_export/relation_factory.rb @@ -35,7 +35,7 @@ module Gitlab def initialize(relation_sym:, relation_hash:, members_mapper:, user:, project:) @relation_name = OVERRIDES[relation_sym] || relation_sym - @relation_hash = relation_hash.except('noteable_id').merge('project_id' => project.id) + @relation_hash = relation_hash.except('noteable_id') @members_mapper = members_mapper @user = user @project = project @@ -248,7 +248,14 @@ module Gitlab end def find_or_create_object! - finder_attributes = @relation_name == :group_label ? %w[title group_id] : %w[title project_id] + # TODO: Trying to find how I can correctly use the correct id depending on the object's type + finder_attributes = if @relation_type == :group_label + %w[title group_id] + elsif parsed_relation_hash['project_id'] + %w[title project_id] + else + %w[title group_id] + end finder_hash = parsed_relation_hash.slice(*finder_attributes) if label? |