Commit d2f8feb7 authored by Eric Davis's avatar Eric Davis

Optimize the N+1 query in watcher_recipients. #5415

Contributed by Holger Just

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3803 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 116c7a79
......@@ -57,7 +57,8 @@ module Redmine
# Returns an array of watchers' email addresses
def watcher_recipients
notified = watchers.collect(&:user).select(&:active?)
notified = watcher_users.active
if respond_to?(:visible?)
notified.reject! {|user| !visible?(user)}
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment