summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/issue.rb7
-rw-r--r--vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb6
2 files changed, 5 insertions, 8 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index a550779cd..b9e046102 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -314,13 +314,6 @@ class Issue < ActiveRecord::Base
notified.collect(&:mail)
end
- # Returns the mail adresses of watchers that should be notified
- def watcher_recipients
- notified = watcher_users
- notified.reject! {|user| !user.active? || !visible?(user)}
- notified.collect(&:mail)
- end
-
# Returns the total number of hours spent on this issue.
#
# Example:
diff --git a/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb
index 977ab4fc7..c13da4fd4 100644
--- a/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb
+++ b/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb
@@ -53,7 +53,11 @@ module Redmine
# Returns an array of watchers' email addresses
def watcher_recipients
- self.watchers.collect { |w| w.user.mail if w.user.active? }.compact
+ notified = watchers.collect(&:user).select(&:active?)
+ if respond_to?(:visible?)
+ notified.reject! {|user| !visible?(user)}
+ end
+ notified.collect(&:mail).compact
end
module ClassMethods