]> source.dussan.org Git - redmine.git/commitdiff
Make use of User.find_by_mail
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 12 Dec 2008 19:11:16 +0000 (19:11 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 12 Dec 2008 19:11:16 +0000 (19:11 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2129 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/mail_handler.rb

index a716412fc5506bf725f8e2ec8eaee7bbdfd3afc7..5add41d72d99f08c3108ca143080ee6c94b2d5de 100644 (file)
@@ -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