diff options
author | James Lopez <james@jameslopez.es> | 2016-05-13 13:33:13 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-05-13 13:33:13 +0300 |
commit | 25a1c6541aa3dfb41ef006d42ba280d5a1d4103d (patch) | |
tree | 5ca5419641746e035c042c9f7807b02db57e1db8 /lib/gitlab/import_export/members_mapper.rb | |
parent | 78cd39e480eea7db7a2e34576c9d6a4446167486 (diff) |
add message to notes about missing author on import
Diffstat (limited to 'lib/gitlab/import_export/members_mapper.rb')
-rw-r--r-- | lib/gitlab/import_export/members_mapper.rb | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/gitlab/import_export/members_mapper.rb b/lib/gitlab/import_export/members_mapper.rb index d6124106f57..da8aa475653 100644 --- a/lib/gitlab/import_export/members_mapper.rb +++ b/lib/gitlab/import_export/members_mapper.rb @@ -2,18 +2,25 @@ module Gitlab module ImportExport class MembersMapper - def self.map(*args) - new(*args).map - end + attr_reader :map, :note_member_list def initialize(exported_members:, user:, project_id:) @exported_members = exported_members @user = user @project_id = project_id + @note_member_list = [] + + @project_member_map = Hash.new do |_, key| + @note_member_list << key + default_project_member + end + + @map = generate_map end - def map - @project_member_map = Hash.new(default_project_member) + private + + def generate_map @exported_members.each do |member| existing_user = User.where(find_project_user_query(member)).first assign_member(existing_user, member) if existing_user @@ -21,8 +28,6 @@ module Gitlab @project_member_map end - private - def assign_member(existing_user, member) old_user_id = member['user']['id'] member['user'] = existing_user |