From f8dc1d1533055fa57c082a5d18562a0a552fe8ca Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Wed, 6 Nov 2024 11:55:59 +0100 Subject: [PATCH] use column.options_for_select --- .../instructeurs/column_filter_value_component.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/components/instructeurs/column_filter_value_component.rb b/app/components/instructeurs/column_filter_value_component.rb index f8b893b64..556494151 100644 --- a/app/components/instructeurs/column_filter_value_component.rb +++ b/app/components/instructeurs/column_filter_value_component.rb @@ -58,18 +58,12 @@ class Instructeurs::ColumnFilterValueComponent < ApplicationComponent Procedure.find(procedure_id).labels.filter_map do [_1.name, _1.id] end + elsif column.is_a?(Columns::ChampColumn) + column.options_for_select else - find_type_de_champ(column.stable_id).options_for_select(column) + [] end end - def find_type_de_champ(stable_id) - TypeDeChamp - .joins(:revision_types_de_champ) - .where(revision_types_de_champ: { revision_id: ProcedureRevision.where(procedure_id:) }) - .order(created_at: :desc) - .find_by(stable_id:) - end - def procedure_id = @column.h_id[:procedure_id] end