From 75ea596e482470d2d4b75614f89c418dae451f8e Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 11 Mar 2024 10:15:42 +0100 Subject: [PATCH] fix(commencer#dossier_vide): use repetition added_champs from repetition instead of creating/iterating over not persisted champs --- app/views/dossiers/dossier_vide.pdf.prawn | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/dossiers/dossier_vide.pdf.prawn b/app/views/dossiers/dossier_vide.pdf.prawn index 5cc886328..fd11c3abf 100644 --- a/app/views/dossiers/dossier_vide.pdf.prawn +++ b/app/views/dossiers/dossier_vide.pdf.prawn @@ -186,12 +186,11 @@ def add_champs(pdf, champs) champs.each do |champ| if champ.type == 'Champs::RepetitionChamp' add_libelle(pdf, champ) - 3.times { champ.add_row(champ.type_de_champ.revision) } + added_champs = champ.add_row(champ.type_de_champ.revision) + 3.times do - champ.rows.each do |row| - row.each do |inner_champ| - render_single_champ(pdf, inner_champ) - end + added_champs.each do |champ| + render_single_champ(pdf, champ) end end else