Consolidate account scopes for LOWER (index using) username/domain queries (#30451)

This commit is contained in:
Matt Jankowski 2024-05-28 10:11:31 -04:00 committed by GitHub
parent 32c30bf0fd
commit 4a77e477ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 14 additions and 48 deletions

View file

@ -22,7 +22,7 @@ module User::LdapAuthenticable
safe_username = safe_username.gsub(keys, replacement)
end
resource = joins(:account).merge(Account.where(Account.arel_table[:username].lower.eq safe_username.downcase)).take
resource = joins(:account).merge(Account.with_username(safe_username)).take
if resource.blank?
resource = new(