Make use of User.find_by_mail
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2129 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
a37f4b9cf6
commit
dcf5ba1ea6
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue