summaryrefslogtreecommitdiff
path: root/lib/gitlab/github_import/user_finder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/github_import/user_finder.rb')
-rw-r--r--lib/gitlab/github_import/user_finder.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/gitlab/github_import/user_finder.rb b/lib/gitlab/github_import/user_finder.rb
index 93483ee697a..efaa2ce3002 100644
--- a/lib/gitlab/github_import/user_finder.rb
+++ b/lib/gitlab/github_import/user_finder.rb
@@ -39,13 +39,9 @@ module Gitlab
#
# If the object has no author ID we'll use the ID of the GitLab ghost
# user.
- def author_id_for(object)
- id =
- if object&.author
- user_id_for(object.author)
- else
- GithubImport.ghost_user_id
- end
+ def author_id_for(object, author_key: :author)
+ user_info = author_key == :actor ? object&.actor : object&.author
+ id = user_info ? user_id_for(user_info) : GithubImport.ghost_user_id
if id
[id, true]