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
This commit is contained in:
parent
116c7a7964
commit
d2f8feb7c5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue