diff options
author | Jan-Willem van der Meer <mail@jewilmeer.nl> | 2014-10-14 11:05:29 +0400 |
---|---|---|
committer | Jan-Willem van der Meer <mail@jewilmeer.nl> | 2014-10-14 11:05:29 +0400 |
commit | 93505f7d04cfbbc9565dc5759dbeb768515520e7 (patch) | |
tree | d9584f5cc724b001c220a20714daa27efe8cf98b /lib/gitlab/ldap/user.rb | |
parent | 410d6e306b04a4bfd321996e1e6548032f8f8b85 (diff) |
DRY find method to find Gitlab user
Diffstat (limited to 'lib/gitlab/ldap/user.rb')
-rw-r--r-- | lib/gitlab/ldap/user.rb | 6 |
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 |