Merge pull request #7578 from betagouv/improve_perf_in_editor

Improve perf in editor
This commit is contained in:
LeSim 2022-07-18 14:36:50 +02:00 committed by GitHub
commit 84a048ac47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,7 +82,14 @@ module Administrateurs
end end
def show 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 @current_administrateur = current_administrateur
@procedure_lien = commencer_url(path: @procedure.path) @procedure_lien = commencer_url(path: @procedure.path)
@procedure_lien_test = commencer_test_url(path: @procedure.path) @procedure_lien_test = commencer_test_url(path: @procedure.path)
@ -289,6 +296,10 @@ module Administrateurs
redirect_to admin_procedure_experts_path(@procedure) redirect_to admin_procedure_experts_path(@procedure)
end end
def champs
@procedure = Procedure.includes(draft_revision: { revision_types_de_champ_public: :type_de_champ }).find(@procedure.id)
end
private private
def apercu_tab def apercu_tab