mirror of
https://github.com/redmine/redmine.git
synced 2025-11-17 02:30:56 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user