summaryrefslogtreecommitdiff
path: root/lib/gitlab/ldap
diff options
context:
space:
mode:
authorJan-Willem van der Meer <mail@jewilmeer.nl>2014-10-14 09:05:29 +0200
committerJan-Willem van der Meer <mail@jewilmeer.nl>2014-10-14 09:05:29 +0200
commit93505f7d04cfbbc9565dc5759dbeb768515520e7 (patch)
treed9584f5cc724b001c220a20714daa27efe8cf98b /lib/gitlab/ldap
parent410d6e306b04a4bfd321996e1e6548032f8f8b85 (diff)
downloadgitlab-ce-93505f7d04cfbbc9565dc5759dbeb768515520e7.tar.gz
DRY find method to find Gitlab user
Diffstat (limited to 'lib/gitlab/ldap')
-rw-r--r--lib/gitlab/ldap/user.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/gitlab/ldap/user.rb b/lib/gitlab/ldap/user.rb
index 3069027a421..9235f6310df 100644
--- a/lib/gitlab/ldap/user.rb
+++ b/lib/gitlab/ldap/user.rb
@@ -29,10 +29,8 @@ module Gitlab
end
def find_by_uid_and_provider
- # LDAP distinguished name is case-insensitive
- model.
- where(provider: [auth_hash.provider, :ldap]).
- where('lower(extern_uid) = ?', auth_hash.uid.downcase).last
+ self.class.find_by_uid_and_provider(
+ auth_hash.provider, auth_hash.uid.downcase)
end
def find_by_email