perf: 500 queries -> 250 procedure show (id: 34908)

This commit is contained in:
simon lehericey 2022-07-18 14:12:43 +02:00
parent 9cfa6205b5
commit c0e8a07868

View file

@ -82,7 +82,14 @@ module Administrateurs
end
def show
@procedure = current_administrateur.procedures.find(params[:id])
@procedure = current_administrateur
.procedures
.includes(
published_revision: { revision_types_de_champ: :type_de_champ },
draft_revision: { revision_types_de_champ: :type_de_champ }
)
.find(params[:id])
@current_administrateur = current_administrateur
@procedure_lien = commencer_url(path: @procedure.path)
@procedure_lien_test = commencer_test_url(path: @procedure.path)