FIX: New avatar regression with mixed case email addresses.

This commit is contained in:
Robin Ward 2013-08-14 13:05:57 -04:00
parent aec929b184
commit 8fa9c51bf4

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(email: email.downcase)
.where(['lower(email) = lower(?)', email])
.first
user.avatar_template if user.present?
end