Merge pull request #1330 from ZogStriP/emails-can-be-mixed-case

only the host part of an email address is case insensitive
This commit is contained in:
Robin Ward 2013-08-14 13:26:49 -07:00
commit 3e7441177a

View file

@ -299,7 +299,7 @@ class User < ActiveRecord::Base
def self.avatar_template(email)
user = User.select([:email, :use_uploaded_avatar, :uploaded_avatar_template, :uploaded_avatar_id])
.where(['lower(email) = lower(?)', email])
.where(email: Email.downcase(email))
.first
user.avatar_template if user.present?
end