From b88d98482864c8b5f2c3e97f0cdb2e910c93d1df Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 9 May 2023 11:38:06 +0200 Subject: [PATCH] fix(instructeur): exclude repetitions from filters/display --- app/models/procedure_presentation.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/procedure_presentation.rb b/app/models/procedure_presentation.rb index 888d56c07..368df595c 100644 --- a/app/models/procedure_presentation.rb +++ b/app/models/procedure_presentation.rb @@ -91,6 +91,7 @@ class ProcedurePresentation < ApplicationRecord fields.concat procedure.types_de_champ_for_procedure_presentation .pluck(:type_champ, :libelle, :private, :stable_id) + .reject { |(type_champ)| type_champ == TypeDeChamp.type_champs.fetch(:repetition) } .map { |(type_champ, libelle, is_private, stable_id)| field_hash(is_private ? TYPE_DE_CHAMP_PRIVATE : TYPE_DE_CHAMP, stable_id.to_s, label: libelle, type: (TypeDeChamp.options_for_select?(type_champ) ? :enum : :text)) } fields