From 81eeff247406138efc9d0de445fbe47465c9fa38 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Mon, 4 Nov 2024 13:27:30 +0100 Subject: [PATCH] cleanup: remove unused code --- app/models/champs/drop_down_list_champ.rb | 8 -------- app/models/champs/linked_drop_down_list_champ.rb | 8 -------- app/models/champs/multiple_drop_down_list_champ.rb | 13 ------------- 3 files changed, 29 deletions(-) diff --git a/app/models/champs/drop_down_list_champ.rb b/app/models/champs/drop_down_list_champ.rb index 67a83f281..4c5306f6c 100644 --- a/app/models/champs/drop_down_list_champ.rb +++ b/app/models/champs/drop_down_list_champ.rb @@ -56,14 +56,6 @@ class Champs::DropDownListChamp < Champ options.include?(value) end - def remove_option(options, touch = false) - if touch - update(value: nil) - else - update_column(:value, nil) - end - end - private def value_is_in_options diff --git a/app/models/champs/linked_drop_down_list_champ.rb b/app/models/champs/linked_drop_down_list_champ.rb index 65e6c576c..c8621efc2 100644 --- a/app/models/champs/linked_drop_down_list_champ.rb +++ b/app/models/champs/linked_drop_down_list_champ.rb @@ -47,14 +47,6 @@ class Champs::LinkedDropDownListChamp < Champ options.include?(primary_value) || options.include?(secondary_value) end - def remove_option(options, touch = false) - if touch - update(value: nil) - else - update_column(:value, nil) - end - end - private def pack_value(primary, secondary) diff --git a/app/models/champs/multiple_drop_down_list_champ.rb b/app/models/champs/multiple_drop_down_list_champ.rb index 2bc715a06..46bbabfb8 100644 --- a/app/models/champs/multiple_drop_down_list_champ.rb +++ b/app/models/champs/multiple_drop_down_list_champ.rb @@ -33,15 +33,6 @@ class Champs::MultipleDropDownListChamp < Champ (selected_options - options).size != selected_options.size end - def remove_option(options, touch = false) - value = (selected_options - options).to_json - if touch - update(value:) - else - update_columns(value:) - end - end - def focusable_input_id render_as_checkboxes? ? checkbox_id(drop_down_options.first) : input_id end @@ -80,10 +71,6 @@ class Champs::MultipleDropDownListChamp < Champ end end - def render? - @champ.drop_down_options.any? - end - private def values_are_in_options