Commit 9a9e22a8 authored by Andrew Smith's avatar Andrew Smith

Rename `gl_user_id` to `gitlab_user_id` in importer classes

parent 43d6328f
......@@ -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
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......@@ -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
......
......@@ -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
......@@ -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
......
......@@ -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
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment