From a53c32b41eeae267e9b4a26e3efaa8ba8489669b Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 31 Mar 2023 10:28:29 +0200 Subject: [PATCH] correctif(validation-des-conditions): les conditions dans un bloc repetable identifient les conditions invalident Update app/models/procedure_revision.rb Co-authored-by: LeSim --- app/models/procedure_revision.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/procedure_revision.rb b/app/models/procedure_revision.rb index 0f1196477..884a5d660 100644 --- a/app/models/procedure_revision.rb +++ b/app/models/procedure_revision.rb @@ -392,6 +392,7 @@ class ProcedureRevision < ApplicationRecord public_tdcs = types_de_champ_public.to_a public_tdcs + .flat_map { _1.repetition? ? children_of(_1) : _1 } .map.with_index .filter_map { |tdc, i| tdc.condition? ? [tdc, i] : nil } .map { |tdc, i| [tdc, tdc.condition.errors(public_tdcs.take(i))] }