From e1999d572950be8780e23f4c9963003b7375135a Mon Sep 17 00:00:00 2001 From: Kara Diaby Date: Tue, 27 Sep 2022 21:56:51 +0200 Subject: [PATCH] fix checkbox mandatory champ --- app/models/champs/checkbox_champ.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/champs/checkbox_champ.rb b/app/models/champs/checkbox_champ.rb index a500abb59..5f52edfd1 100644 --- a/app/models/champs/checkbox_champ.rb +++ b/app/models/champs/checkbox_champ.rb @@ -27,4 +27,8 @@ class Champs::CheckboxChamp < Champs::YesNoChamp def for_export true? ? 'on' : 'off' end + + def mandatory_blank_and_visible? + mandatory? && (blank? || !true?) + end end