add region and department champs in choice method
This commit is contained in:
parent
cde8c614e6
commit
b7868798ae
1 changed files with 2 additions and 2 deletions
|
@ -307,7 +307,7 @@ class TypeDeChamp < ApplicationRecord
|
|||
end
|
||||
|
||||
def self.is_choice_type_from(type_champ)
|
||||
TYPE_DE_CHAMP_TO_CATEGORIE[type_champ.to_sym] == CHOICE
|
||||
TYPE_DE_CHAMP_TO_CATEGORIE[type_champ.to_sym] == CHOICE || type_champ.in?([TypeDeChamp.type_champs.fetch(:departements), TypeDeChamp.type_champs.fetch(:regions)])
|
||||
end
|
||||
|
||||
def drop_down_list?
|
||||
|
@ -480,7 +480,7 @@ class TypeDeChamp < ApplicationRecord
|
|||
end
|
||||
|
||||
def self.filter_hash_type(type_champ)
|
||||
if type_champ.in?([TypeDeChamp.type_champs.fetch(:departements), TypeDeChamp.type_champs.fetch(:regions)]) || is_choice_type_from(type_champ)
|
||||
if is_choice_type_from(type_champ)
|
||||
:enum
|
||||
else
|
||||
:text
|
||||
|
|
Loading…
Reference in a new issue