Merge pull request #8387 from demarches-simplifiees/US/fix-missing-dossier-preload

fix(instructeurs/dossier#show): missing preload on dossier
This commit is contained in:
mfo 2023-01-10 09:38:23 +01:00 committed by GitHub
commit 07001e8866
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -271,14 +271,14 @@ module Instructeurs
end
def dossier
@dossier ||= dossier_scope.find(params[:dossier_id])
@dossier ||= DossierPreloader.load_one(dossier_scope.find(params[:dossier_id]))
end
def dossier_with_champs
@dossier ||= dossier_scope
@dossier ||= DossierPreloader.load_one(dossier_scope
.with_champs
.with_annotations
.find(params[:dossier_id])
.find(params[:dossier_id]))
end
def commentaire_params

View file

@ -33,7 +33,7 @@
= link_to t('views.shared.dossiers.demande.edit_identity'), identite_dossier_path(dossier), class: 'fr-btn fr-btn--tertiary'
%h2.fr-h6= t('views.shared.dossiers.demande.form')
- champs = dossier.champs_public.includes(:type_de_champ)
- champs = dossier.champs_public
- if champs.any? || dossier.procedure.routing_enabled?
.card
= render partial: "shared/dossiers/champs", locals: { champs: champs, dossier: dossier, demande_seen_at: demande_seen_at, profile: profile }