mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-19 09:36:47 +10:00
import working!
This commit is contained in:
@@ -74,9 +74,8 @@ module Projects
|
||||
relation.values.flatten.each do |sub_relation|
|
||||
relation_hash = relation_item[sub_relation.to_s]
|
||||
next if relation_hash.blank?
|
||||
relation_hash.merge!('project_id' => project.id) if sub_relation == :merge_requests
|
||||
sub_relation_object = Projects::ImportExport::RelationFactory.create(
|
||||
relation_sym: sub_relation, relation_hash: relation_hash, members_map: members_map)
|
||||
relation_sym: sub_relation, relation_hash: relation_hash.merge!('project_id' => project.id), members_map: members_map)
|
||||
relation_item[sub_relation.to_s] = sub_relation_object
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@ module Projects
|
||||
module RelationFactory
|
||||
extend self
|
||||
|
||||
OVERRIDES = { snippets: :project_snippets }.freeze
|
||||
OVERRIDES = { snippets: :project_snippets, commit: 'Ci::Commit' }.freeze
|
||||
USER_REFERENCES = %w(author_id assignee_id updated_by_id).freeze
|
||||
|
||||
def create(relation_sym:, relation_hash:, members_map:)
|
||||
@@ -11,6 +11,7 @@ module Projects
|
||||
relation_sym = parse_relation_sym(relation_sym)
|
||||
klass = relation_class(relation_sym)
|
||||
relation_hash.delete('id') #screw IDs for now
|
||||
relation_hash.delete('project_id') unless klass.column_names.include?(:project_id)
|
||||
handle_merge_requests(relation_hash) if relation_sym == :merge_requests
|
||||
update_user_references(relation_hash, members_map)
|
||||
imported_object = klass.new(relation_hash)
|
||||
|
||||
Reference in New Issue
Block a user