Merge pull request #1028 from sgmap/improve_perf_dossier_show

Remove N+1 query on Dossier#show
This commit is contained in:
gregoirenovel 2017-12-01 17:58:57 +01:00 committed by GitHub
commit 702a7f6f0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,7 @@
= render partial: "identite_individual", locals: { individual: @dossier.individual }
.accompagnateur-title Formulaire
- champs = @dossier.ordered_champs.decorate
- champs = @dossier.ordered_champs.includes(:type_de_champ).decorate
- if champs.any?
.card
= render partial: "champs", locals: { champs: champs }