summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-12-12 19:11:16 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-12-12 19:11:16 +0000
commitdcf5ba1ea6cc66c49bb6af2e456ee2790707fc9a (patch)
tree93f3fb38d1e8830b5c90e878bf71a76ad80894ce
parenta37f4b9cf6991f5cde39d908e2549b1242b04859 (diff)
downloadredmine-dcf5ba1ea6cc66c49bb6af2e456ee2790707fc9a.tar.gz
redmine-dcf5ba1ea6cc66c49bb6af2e456ee2790707fc9a.zip
Make use of User.find_by_mail
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2129 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/mail_handler.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index a716412fc..5add41d72 100644
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -39,7 +39,7 @@ class MailHandler < ActionMailer::Base
# Processes incoming emails
def receive(email)
@email = email
- @user = User.active.find(:first, :conditions => ["LOWER(mail) = ?", email.from.first.to_s.strip.downcase])
+ @user = User.active.find_by_mail(email.from.first.to_s.strip)
unless @user
# Unknown user => the email is ignored
# TODO: ability to create the user's account