fix: champ_value for tdc destroyed

This commit is contained in:
simon lehericey 2022-07-11 21:31:06 +02:00
parent 2fee0ddfd4
commit faa2797d80

View file

@ -33,10 +33,10 @@ class Logic::ChampValue < Logic::Term
end
end
def to_s = "#{type_de_champ.libelle}#{stable_id}"
def to_s = "#{type_de_champ&.libelle}#{stable_id}" # TODO: gerer le cas ou un tdc est supprimé
def type
case type_de_champ.type_champ
case type_de_champ&.type_champ # TODO: gerer le cas ou un tdc est supprimé
when MANAGED_TYPE_DE_CHAMP.fetch(:yes_no),
MANAGED_TYPE_DE_CHAMP.fetch(:checkbox)
CHAMP_VALUE_TYPE.fetch(:boolean)