diff --git a/app/models/procedure_presentation.rb b/app/models/procedure_presentation.rb index 5939f68cf..a14ad5faf 100644 --- a/app/models/procedure_presentation.rb +++ b/app/models/procedure_presentation.rb @@ -40,6 +40,12 @@ class ProcedurePresentation < ApplicationRecord attribute :expirant_filters, :jsonb, array: true attribute :archives_filters, :jsonb, array: true + def filters_for(statut) + send(filters_name_for(statut)) + end + + def filters_name_for(statut) = statut.tr('-', '_').then { "#{_1}_filters" } + def displayed_fields_for_headers [ Column.new(procedure_id: procedure.id, table: 'self', column: 'id', classname: 'number-col'),