add filters for

This commit is contained in:
simon lehericey 2024-10-07 18:10:08 +02:00
parent 3d79c6176e
commit 0abee08329
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5

View file

@ -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'),