diff options
author | David Yip <yipdw@member.fsf.org> | 2018-03-27 10:44:12 -0500 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2018-03-27 10:44:12 -0500 |
commit | d2cdc2b5a37f9c9d56242e3540ff62cccff4b1ae (patch) | |
tree | 7a18011a34ee3f2c87c826797bf0443c5765d99e /app/validators | |
parent | 49c957bc3bf186b7e560d09d605f24693338c5db (diff) | |
parent | 3523aa440ba3f52bf28fe1e9707506d327c4431f (diff) |
Merge remote-tracking branch 'origin/master' into gs-master
Diffstat (limited to 'app/validators')
-rw-r--r-- | app/validators/unique_username_validator.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/validators/unique_username_validator.rb b/app/validators/unique_username_validator.rb index c76407b16..fb67105dd 100644 --- a/app/validators/unique_username_validator.rb +++ b/app/validators/unique_username_validator.rb @@ -6,7 +6,7 @@ class UniqueUsernameValidator < ActiveModel::Validator normalized_username = account.username.downcase.delete('.') - scope = Account.where(domain: nil, username: normalized_username) + scope = Account.where(domain: nil).where('lower(username) = ?', normalized_username) scope = scope.where.not(id: account.id) if account.persisted? account.errors.add(:username, :taken) if scope.exists? |