From: Jean-Philippe Lang Date: Sun, 12 Jun 2016 12:24:54 +0000 (+0000) Subject: Merged r15518. X-Git-Tag: 3.3.0~27 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9a59df3a7beaed8c1f61ea5b230167a6b3b9c3e0;p=redmine.git Merged r15518. git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@15520 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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