summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-06-12 12:21:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-06-12 12:21:57 +0000
commit10c22b5384a4bc2c7977675716a2372e72def8da (patch)
tree4eb8008675f1c1d2b777a7659432f1fd4035fec9 /app/models
parent49cdcba2d2f19fde63ff1f0be9562c478ce08d38 (diff)
downloadredmine-10c22b5384a4bc2c7977675716a2372e72def8da.tar.gz
redmine-10c22b5384a4bc2c7977675716a2372e72def8da.zip
Preload principals.
git-svn-id: http://svn.redmine.org/redmine/trunk@15518 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-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 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