diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-10-10 21:42:24 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-10-10 21:42:24 +0000 |
commit | 700c302fca1ef401eff2744ffc5d955406136b17 (patch) | |
tree | 971c3a59e56ba799c8ba61d546705a90d2d51347 /app | |
parent | d2986eb98fa4ec163cf09c82a36fff3ca8f5f48b (diff) | |
download | redmine-700c302fca1ef401eff2744ffc5d955406136b17.tar.gz redmine-700c302fca1ef401eff2744ffc5d955406136b17.zip |
Change Project#notified_users to check for the 'all' notification option. #6541
The previous mail_notification? check would always pass since the
notifications where converted to strings and strings are always true.
Also changed Project#recipients to use #notified_users instead of duplicated
code.
Based on contribution by Felix Schäfer.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4247 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 0bb67e420..000efa7c2 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -382,12 +382,13 @@ class Project < ActiveRecord::Base # Returns the mail adresses of users that should be always notified on project events def recipients - members.select {|m| m.mail_notification? || m.user.mail_notification == 'all'}.collect {|m| m.user.mail} + notified_users.collect {|user| user.mail} end # Returns the users that should be notified on project events def notified_users - members.select {|m| m.mail_notification? || m.user.mail_notification?}.collect {|m| m.user} + # TODO: User part should be extracted to User#notify_about? + members.select {|m| m.mail_notification? || m.user.mail_notification == 'all'}.collect {|m| m.user} end # Returns an array of all custom fields enabled for project issues |