Cache champ attributes

This commit is contained in:
Damien Le Thiec 2023-02-22 20:05:36 +01:00
parent 731cd56594
commit 61d2edc42e

View file

@ -57,11 +57,11 @@ class PrefillParams
end
def prefillable?
champ.prefillable? && valid?
champ.prefillable? && valid? && champ_attributes.present?
end
def champ_attributes
TypesDeChamp::PrefillTypeDeChamp
@champ_attributes ||= TypesDeChamp::PrefillTypeDeChamp
.build(champ.type_de_champ, dossier.revision)
.to_assignable_attributes(champ, value)
end