From 9a59df3a7beaed8c1f61ea5b230167a6b3b9c3e0 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 12 Jun 2016 12:24:54 +0000 Subject: [PATCH] Merged r15518. git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@15520 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/project.rb b/app/models/project.rb index dee2e6dfd..e9b2647d4 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -524,7 +524,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.principal.present? && (m.mail_notification? || m.principal.mail_notification == 'all')}.collect {|m| m.principal} + members.preload(:principal).select {|m| m.principal.present? && (m.mail_notification? || m.principal.mail_notification == 'all')}.collect {|m| m.principal} end # Returns a scope of all custom fields enabled for project issues -- 2.39.5