Skip to content
Snippets Groups Projects
Unverified Commit 9a9e22a8 authored by Andrew Smith's avatar Andrew Smith
Browse files

Rename `gl_user_id` to `gitlab_user_id` in importer classes

parent 43d6328f
No related branches found
No related tags found
1 merge request!6254Rename `gl_user_id` to `gitlab_user_id` in importer classes
Loading
Loading
@@ -21,7 +21,7 @@ module Gitlab
 
private
 
def gl_user_id(project, bitbucket_id)
def gitlab_user_id(project, bitbucket_id)
if bitbucket_id
user = User.joins(:identities).find_by("identities.extern_uid = ? AND identities.provider = 'bitbucket'", bitbucket_id.to_s)
(user && user.id) || project.creator_id
Loading
Loading
@@ -74,7 +74,7 @@ module Gitlab
description: body,
title: issue["title"],
state: %w(resolved invalid duplicate wontfix closed).include?(issue["status"]) ? 'closed' : 'opened',
author_id: gl_user_id(project, reporter)
author_id: gitlab_user_id(project, reporter)
)
end
rescue ActiveRecord::RecordInvalid => e
Loading
Loading
Loading
Loading
@@ -15,7 +15,7 @@ module Gitlab
 
private
 
def gl_user_id(github_id)
def gitlab_user_id(github_id)
User.joins(:identities).
find_by("identities.extern_uid = ? AND identities.provider = 'github'", github_id.to_s).
try(:id)
Loading
Loading
Loading
Loading
@@ -21,7 +21,7 @@ module Gitlab
end
 
def author_id
gl_user_id(raw_data.user.id) || project.creator_id
gitlab_user_id(raw_data.user.id) || project.creator_id
end
 
def body
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@ module Gitlab
 
def assignee_id
if assigned?
gl_user_id(raw_data.assignee.id)
gitlab_user_id(raw_data.assignee.id)
end
end
 
Loading
Loading
@@ -49,7 +49,7 @@ module Gitlab
end
 
def author_id
gl_user_id(raw_data.user.id) || project.creator_id
gitlab_user_id(raw_data.user.id) || project.creator_id
end
 
def body
Loading
Loading
Loading
Loading
@@ -68,7 +68,7 @@ module Gitlab
 
def assignee_id
if assigned?
gl_user_id(raw_data.assignee.id)
gitlab_user_id(raw_data.assignee.id)
end
end
 
Loading
Loading
@@ -77,7 +77,7 @@ module Gitlab
end
 
def author_id
gl_user_id(raw_data.user.id) || project.creator_id
gitlab_user_id(raw_data.user.id) || project.creator_id
end
 
def body
Loading
Loading
Loading
Loading
@@ -41,7 +41,7 @@ module Gitlab
title: issue["title"],
state: issue["state"],
updated_at: issue["updated_at"],
author_id: gl_user_id(project, issue["author"]["id"])
author_id: gitlab_user_id(project, issue["author"]["id"])
)
end
end
Loading
Loading
@@ -51,7 +51,7 @@ module Gitlab
 
private
 
def gl_user_id(project, gitlab_id)
def gitlab_user_id(project, gitlab_id)
user = User.joins(:identities).find_by("identities.extern_uid = ? AND identities.provider = 'gitlab'", gitlab_id.to_s)
(user && user.id) || project.creator_id
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment