summaryrefslogtreecommitdiffstats
path: root/app/models/mail_handler.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-11-30 16:57:56 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-11-30 16:57:56 +0000
commite7b6a56a972eaed14386d737929f84a7ef59e9a5 (patch)
treec50137923b3a42c1e894fc0896554e2f4bbb33dd /app/models/mail_handler.rb
parent957269930159ddde35324d0666678753ff4bff0b (diff)
downloadredmine-e7b6a56a972eaed14386d737929f84a7ef59e9a5.tar.gz
redmine-e7b6a56a972eaed14386d737929f84a7ef59e9a5.zip
Replaces User.find_active with a named scope.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2079 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/mail_handler.rb')
-rw-r--r--app/models/mail_handler.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index fcb469c60..a716412fc 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.find_active(:first, :conditions => ["LOWER(mail) = ?", email.from.first.to_s.strip.downcase])
+ @user = User.active.find(:first, :conditions => ["LOWER(mail) = ?", email.from.first.to_s.strip.downcase])
unless @user
# Unknown user => the email is ignored
# TODO: ability to create the user's account
@@ -149,7 +149,7 @@ class MailHandler < ActionMailer::Base
if user.allowed_to?("add_#{obj.class.name.underscore}_watchers".to_sym, obj.project)
addresses = [email.to, email.cc].flatten.compact.uniq.collect {|a| a.strip.downcase}
unless addresses.empty?
- watchers = User.find_active(:all, :conditions => ['LOWER(mail) IN (?)', addresses])
+ watchers = User.active.find(:all, :conditions => ['LOWER(mail) IN (?)', addresses])
watchers.each {|w| obj.add_watcher(w)}
end
end