fix commit suggestions from GH

This commit is contained in:
Lisa Durand 2023-10-11 17:48:20 +02:00
parent 3c2d913a44
commit da8a887083

View file

@ -306,6 +306,7 @@ class TypeDeChamp < ApplicationRecord
end end
def self.is_choice_type_from(type_champ) def self.is_choice_type_from(type_champ)
return false if type_champ == TypeDeChamp.type_champs.fetch(:linked_drop_down_list) # To remove when we stop using linked_drop_down_list
TYPE_DE_CHAMP_TO_CATEGORIE[type_champ.to_sym] == CHOICE || type_champ.in?([TypeDeChamp.type_champs.fetch(:departements), TypeDeChamp.type_champs.fetch(:regions)]) TYPE_DE_CHAMP_TO_CATEGORIE[type_champ.to_sym] == CHOICE || type_champ.in?([TypeDeChamp.type_champs.fetch(:departements), TypeDeChamp.type_champs.fetch(:regions)])
end end
@ -501,7 +502,7 @@ class TypeDeChamp < ApplicationRecord
APIGeoService.regions.map { [_1[:name], _1[:code]] } APIGeoService.regions.map { [_1[:name], _1[:code]] }
elsif choice_type? elsif choice_type?
if drop_down_list? if drop_down_list?
enabled_non_empty_options drop_down_list_enabled_non_empty_options
elsif yes_no? elsif yes_no?
Champs::YesNoChamp.options Champs::YesNoChamp.options
elsif checkbox? elsif checkbox?