]> source.dussan.org Git - redmine.git/commitdiff
remove unneeded Relation#all from MailHandler#add_watchers
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 9 Jan 2014 00:05:50 +0000 (00:05 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 9 Jan 2014 00:05:50 +0000 (00:05 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12542 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/mail_handler.rb

index 7a420942909de89f3baf53cdcc5de16c8e2afe47..2a16f0fa38e21c947ce5d874b7d6b35d0159ca30 100644 (file)
@@ -296,8 +296,9 @@ 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.active.where('LOWER(mail) IN (?)', addresses).all
-        watchers.each {|w| obj.add_watcher(w)}
+        User.active.where('LOWER(mail) IN (?)', addresses).each do |w|
+          obj.add_watcher(w)
+        end
       end
     end
   end