@@ -31,22 +31,6 @@ def build_prefill_values
3131 end
3232
3333 class PrefillValue
34- NEED_VALIDATION_TYPES_DE_CHAMPS = [
35- TypeDeChamp . type_champs . fetch ( :decimal_number ) ,
36- TypeDeChamp . type_champs . fetch ( :integer_number ) ,
37- TypeDeChamp . type_champs . fetch ( :date ) ,
38- TypeDeChamp . type_champs . fetch ( :datetime ) ,
39- TypeDeChamp . type_champs . fetch ( :civilite ) ,
40- TypeDeChamp . type_champs . fetch ( :yes_no ) ,
41- TypeDeChamp . type_champs . fetch ( :checkbox ) ,
42- TypeDeChamp . type_champs . fetch ( :pays ) ,
43- TypeDeChamp . type_champs . fetch ( :regions ) ,
44- TypeDeChamp . type_champs . fetch ( :departements ) ,
45- TypeDeChamp . type_champs . fetch ( :multiple_drop_down_list ) ,
46- TypeDeChamp . type_champs . fetch ( :epci ) ,
47- TypeDeChamp . type_champs . fetch ( :dossier_link ) ,
48- ]
49-
5034 attr_reader :champ , :value , :dossier
5135
5236 def initialize ( champ :, value :, dossier :)
@@ -56,7 +40,7 @@ def initialize(champ:, value:, dossier:)
5640 end
5741
5842 def prefillable?
59- champ . prefillable? && champ_attributes . present? && valid?
43+ champ . prefillable? && champ_attributes . present?
6044 end
6145
6246 # An array of [champ, attributes] pairs; a repetition champ expands to
@@ -70,14 +54,5 @@ def champ_attributes
7054 . build ( champ . type_de_champ , dossier . revision )
7155 . to_assignable_attributes ( champ , value )
7256 end
73-
74- private
75-
76- def valid?
77- return true unless NEED_VALIDATION_TYPES_DE_CHAMPS . include? ( champ . type_champ )
78-
79- champ . assign_attributes ( champ_attributes )
80- champ . valid? ( :prefill )
81- end
8257 end
8358end
0 commit comments