diff options
Diffstat (limited to 'lib/gitlab/github_import/user_finder.rb')
-rw-r--r-- | lib/gitlab/github_import/user_finder.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/gitlab/github_import/user_finder.rb b/lib/gitlab/github_import/user_finder.rb index efaa2ce3002..6d6a00d260d 100644 --- a/lib/gitlab/github_import/user_finder.rb +++ b/lib/gitlab/github_import/user_finder.rb @@ -40,7 +40,17 @@ module Gitlab # If the object has no author ID we'll use the ID of the GitLab ghost # user. def author_id_for(object, author_key: :author) - user_info = author_key == :actor ? object&.actor : object&.author + user_info = case author_key + when :actor + object&.actor + when :assignee + object&.assignee + when :assigner + object&.assigner + else + object&.author + end + id = user_info ? user_id_for(user_info) : GithubImport.ghost_user_id if id @@ -148,7 +158,7 @@ module Gitlab # rubocop: disable CodeReuse/ActiveRecord def query_id_for_github_email(email) - User.by_any_email(email).pluck(:id).first + User.by_any_email(email).pick(:id) end # rubocop: enable CodeReuse/ActiveRecord |