From 5ca187ba57c3578648f25ea48076352d2c019f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 14 Aug 2013 19:31:35 +0200 Subject: [PATCH] only the host part of an email address is case insensitive --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 062b3f620..9502fd077 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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