summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-22 10:12:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-22 10:12:59 +0000
commit18d1c62ca8a8de3ecc0b8731335a49195dafd192 (patch)
treeb49981c1b72d97d9f3495bb1620f446ad353fd92
parent5ce2f4f81c3315287f8725b423a05f6b71fd2ba8 (diff)
downloadredmine-18d1c62ca8a8de3ecc0b8731335a49195dafd192.tar.gz
redmine-18d1c62ca8a8de3ecc0b8731335a49195dafd192.zip
Use eager loaded #principal association instead of #user (#11904).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10442 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/project.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 71ffdc8f5..9a65bdd2e 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -472,7 +472,7 @@ class Project < ActiveRecord::Base
# Returns the users that should be notified on project events
def notified_users
# TODO: User part should be extracted to User#notify_about?
- members.select {|m| m.mail_notification? || m.user.mail_notification == 'all'}.collect {|m| m.principal}
+ members.select {|m| m.principal.present? && (m.mail_notification? || m.principal.mail_notification == 'all')}.collect {|m| m.principal}
end
# Returns an array of all custom fields enabled for project issues