summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 8205c3e29b9..f436efd604f 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -267,6 +267,11 @@ class User < ActiveRecord::Base
end
end
+ def for_github_id(id)
+ joins(:identities)
+ .where(identities: { provider: :github, extern_uid: id.to_s })
+ end
+
# Find a User by their primary email or any associated secondary email
def find_by_any_email(email)
by_any_email(email).take