diff --git a/app/models/procedure_presentation.rb b/app/models/procedure_presentation.rb index 0b658780b..7c0ad678a 100644 --- a/app/models/procedure_presentation.rb +++ b/app/models/procedure_presentation.rb @@ -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)