Refactor: Move recipients method into acts_as_event

acts_as_event should be the standard interface to Redmine events, like mail
notifications, so having a standard recipients implementation there makes sense.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3358 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-02-01 18:57:12 +00:00
parent d43c860448
commit 358e3194d7
4 changed files with 7 additions and 21 deletions
+7
View File
@@ -68,6 +68,13 @@ module Redmine
(option.is_a?(Proc) ? option.call(self) : send(option)).merge(options)
end
# Returns the mail adresses of users that should be notified
def recipients
notified = project.notified_users
notified.reject! {|user| !visible?(user)}
notified.collect(&:mail)
end
module ClassMethods
end
end