refactor(champs): if champ not found - build it

This commit is contained in:
Paul Chavard 2024-03-14 15:13:13 +01:00
parent fd2e253ebc
commit 900db5624f
24 changed files with 128 additions and 118 deletions

View file

@ -319,6 +319,10 @@ def build_types_de_champ(types_de_champ, revision:, scope: :public, parent: nil)
type_de_champ_attributes[:editable_options] = layers.index_with { '1' }
end
if type == :header_section
type_de_champ_attributes[:header_section_level] = type_de_champ_attributes.delete(:level)
end
type_de_champ = if scope == :private
build(:"type_de_champ_#{type}", :private, no_coordinate: true, **type_de_champ_attributes)
else