Patch #23328 » 0001-Improving-performance-of-project-notified_users-by-e.patch
| app/models/project.rb | ||
|---|---|---|
|
# 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.eager_load(:principal).find_each()
|
||
|
.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
|
||