From 700c302fca1ef401eff2744ffc5d955406136b17 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Sun, 10 Oct 2010 21:42:24 +0000 Subject: Change Project#notified_users to check for the 'all' notification option. #6541 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- app/models/project.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app') 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 -- cgit v1.2.3