Patch #23328 » 0001-Improving-performance-of-project-notified_users-by-e.patch
app/models/project.rb | ||
---|---|---|
524 | 524 |
# Returns the users that should be notified on project events |
525 | 525 |
def notified_users |
526 | 526 |
# TODO: User part should be extracted to User#notify_about? |
527 |
members.select {|m| m.principal.present? && (m.mail_notification? || m.principal.mail_notification == 'all')}.collect {|m| m.principal} |
|
527 |
members.eager_load(:principal).find_each() |
|
528 |
.select {|m| m.principal.present? && (m.mail_notification? || m.principal.mail_notification == 'all')} |
|
529 |
.collect {|m| m.principal} |
|
528 | 530 |
end |
529 | 531 | |
530 | 532 |
# Returns a scope of all custom fields enabled for project issues |