Avoid n+1 because of user.email

This commit is contained in:
Mathieu Magnin 2017-07-31 18:00:43 +02:00
parent a3c0404302
commit d780ab1c90

View file

@ -27,19 +27,21 @@ module NewGestionnaire
@a_suivre_dossiers = procedure
.dossiers
.includes(:user)
.without_followers
.en_cours
@followed_dossiers = current_gestionnaire
.followed_dossiers
.includes(:user)
.where(procedure: @procedure)
.en_cours
@termines_dossiers = procedure.dossiers.termine
@termines_dossiers = procedure.dossiers.includes(:user).termine
@all_state_dossiers = procedure.dossiers.all_state
@all_state_dossiers = procedure.dossiers.includes(:user).all_state
@archived_dossiers = procedure.dossiers.archived
@archived_dossiers = procedure.dossiers.includes(:user).archived
@statut = params[:statut].present? ? params[:statut] : 'a-suivre'