add_filter double write

This commit is contained in:
simon lehericey 2024-10-07 22:05:31 +02:00
parent 5f6d8e93ca
commit 870d67e844
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
2 changed files with 5 additions and 0 deletions

View file

@ -117,6 +117,7 @@ class ProcedurePresentation < ApplicationRecord
'value' => value 'value' => value
} }
filters_for(statut) << { id: h_id, filter: value }
update(filters: updated_filters) update(filters: updated_filters)
end end
end end

View file

@ -862,6 +862,10 @@ describe ProcedurePresentation do
{ "label" => first_type_de_champ.libelle, "table" => "type_de_champ", "column" => first_type_de_champ_id, "value" => "true", "value_column" => "value" } { "label" => first_type_de_champ.libelle, "table" => "type_de_champ", "column" => first_type_de_champ_id, "value" => "true", "value_column" => "value" }
] ]
}) })
suivis = procedure_presentation.suivis_filters.map { [_1['id'], _1['filter']] }
expect(suivis).to eq([[{ "column_id" => "type_de_champ/#{first_type_de_champ_id}", "procedure_id" => procedure.id }, "true"]])
end end
end end