Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
22a33d82
Commit
22a33d82
authored
Apr 24, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid unnecessary use of Arel to find users by external uid
parent
5c72ba0f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
lib/github/import.rb
lib/github/import.rb
+1
-3
No files found.
lib/github/import.rb
View file @
22a33d82
...
@@ -355,11 +355,9 @@ module Github
...
@@ -355,11 +355,9 @@ module Github
def
user_id_by_external_uid
(
id
)
def
user_id_by_external_uid
(
id
)
return
nil
unless
id
return
nil
unless
id
identities
=
::
Identity
.
arel_table
::
User
.
select
(
:id
)
::
User
.
select
(
:id
)
.
joins
(
:identities
)
.
joins
(
:identities
)
.
where
(
identities
[
:provider
].
eq
(
:github
).
and
(
identities
[
:extern_uid
].
eq
(
id
)
))
.
merge
(
::
Identity
.
where
(
provider: :github
,
extern_uid:
id
))
.
first
&
.
id
.
first
&
.
id
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment