use drop_down_options when possible

This commit is contained in:
simon lehericey 2024-09-20 10:56:12 +02:00
parent 77b754a08d
commit 8b5f689a67
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
14 changed files with 81 additions and 92 deletions

View file

@ -15,7 +15,7 @@ class TypesDeChampEditor::ConditionsComponentPreview < ViewComponent::Preview
def with_conditions
surface = TypeDeChamp.create(type_champ: :integer_number, libelle: 'surface')
appartement = TypeDeChamp.create(type_champ: :yes_no, libelle: 'appartement')
type_appartement = TypeDeChamp.create(type_champ: :drop_down_list, libelle: 'type', drop_down_list_value: "T1\r\nT2\r\nT3")
type_appartement = TypeDeChamp.create(type_champ: :drop_down_list, libelle: 'type', drop_down_options: ["T1", "T2", "T3"])
upper_tdcs = [surface, appartement, type_appartement]
condition = ds_and([

View file

@ -19,7 +19,7 @@ describe Procedure::OneGroupeManagementComponent, type: :component do
procedure.draft_revision.add_type_de_champ({
type_champ: :drop_down_list,
libelle: 'Votre ville',
drop_down_list_value: "Paris\nLyon\nMarseille"
drop_down_options: ["Paris", "Lyon", "Marseille"]
})
procedure.publish_revision!
procedure.reload