summaryrefslogtreecommitdiff
path: root/lib/github
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-04-24 20:45:51 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-04-24 20:45:51 -0300
commit22a33d8256101b0a5f348ae93623d4b189a96d47 (patch)
tree247f40f4853914a710ac6eba276438cb57ebb250 /lib/github
parent5c72ba0ff1be82f31c292765e8d6a76277327979 (diff)
downloadgitlab-ce-22a33d8256101b0a5f348ae93623d4b189a96d47.tar.gz
Avoid unnecessary use of Arel to find users by external uid
Diffstat (limited to 'lib/github')
-rw-r--r--lib/github/import.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/github/import.rb b/lib/github/import.rb
index 56b0b7a3d4f..ba30ea0e2cd 100644
--- a/lib/github/import.rb
+++ b/lib/github/import.rb
@@ -355,11 +355,9 @@ module Github
def user_id_by_external_uid(id)
return nil unless id
- identities = ::Identity.arel_table
-
::User.select(:id)
.joins(:identities)
- .where(identities[:provider].eq(:github).and(identities[:extern_uid].eq(id)))
+ .merge(::Identity.where(provider: :github, extern_uid: id))
.first&.id
end