remove last field_hash

This commit is contained in:
simon lehericey 2024-07-19 17:05:08 +02:00 committed by mfo
parent 305b8c13c7
commit 969282e453
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC

View file

@ -41,9 +41,9 @@ class ProcedurePresentation < ApplicationRecord
def displayed_fields_for_headers
[
field_hash('self', 'id', classname: 'number-col'),
Facet.new(table: 'self', column: 'id', classname: 'number-col'),
*displayed_fields.map { Facet.new(**_1.deep_symbolize_keys) },
field_hash('self', 'state', classname: 'state-col'),
Facet.new(table: 'self', column: 'state', classname: 'state-col'),
*Facet.sva_svr_facets(procedure:)
]
end
@ -368,24 +368,6 @@ class ProcedurePresentation < ApplicationRecord
end
end
def field_hash(table, column, label: nil, classname: '', virtual: false, type: :text, scope: '', value_column: :value, filterable: true)
Facet.new(table:, column:, label:, classname:, virtual:, type:, scope:, value_column:, filterable:)
end
def field_hash_for_type_de_champ_public(type_champ, libelle, stable_id)
field_hash(TYPE_DE_CHAMP, stable_id.to_s,
label: libelle,
type: TypeDeChamp.filter_hash_type(type_champ),
value_column: TypeDeChamp.filter_hash_value_column(type_champ))
end
def field_hash_for_type_de_champ_private(type_champ, libelle, stable_id)
field_hash(TYPE_DE_CHAMP_PRIVATE, stable_id.to_s,
label: libelle,
type: TypeDeChamp.filter_hash_type(type_champ),
value_column: TypeDeChamp.filter_hash_value_column(type_champ))
end
def valid_column?(table, column, extra_columns = {})
valid_columns_for_table(table).include?(column) ||
extra_columns[table]&.include?(column)