Merge pull request #8100 from tchak/cleanup-dead-code
chore(dossier): cleanup champs nested attributes
This commit is contained in:
commit
9a8c1ce224
2 changed files with 2 additions and 12 deletions
|
@ -394,11 +394,6 @@ module Users
|
||||||
champs_public_attributes: [
|
champs_public_attributes: [
|
||||||
:id, :value, :value_other, :external_id, :primary_value, :secondary_value, :numero_allocataire, :code_postal, :identifiant, :numero_fiscal, :reference_avis, :ine, :piece_justificative_file, :departement, :code_departement, value: [],
|
:id, :value, :value_other, :external_id, :primary_value, :secondary_value, :numero_allocataire, :code_postal, :identifiant, :numero_fiscal, :reference_avis, :ine, :piece_justificative_file, :departement, :code_departement, value: [],
|
||||||
champs_attributes: [:id, :_destroy, :value, :value_other, :external_id, :primary_value, :secondary_value, :numero_allocataire, :code_postal, :identifiant, :numero_fiscal, :reference_avis, :ine, :piece_justificative_file, :departement, :code_departement, value: []]
|
champs_attributes: [:id, :_destroy, :value, :value_other, :external_id, :primary_value, :secondary_value, :numero_allocataire, :code_postal, :identifiant, :numero_fiscal, :reference_avis, :ine, :piece_justificative_file, :departement, :code_departement, value: []]
|
||||||
],
|
|
||||||
# FIXME: remove after migration
|
|
||||||
champs_attributes: [
|
|
||||||
:id, :value, :value_other, :external_id, :primary_value, :secondary_value, :numero_allocataire, :code_postal, :identifiant, :numero_fiscal, :reference_avis, :ine, :piece_justificative_file, :departement, :code_departement, value: [],
|
|
||||||
champs_attributes: [:id, :_destroy, :value, :value_other, :external_id, :primary_value, :secondary_value, :numero_allocataire, :code_postal, :identifiant, :numero_fiscal, :reference_avis, :ine, :piece_justificative_file, :departement, :code_departement, value: []]
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
@ -457,12 +452,7 @@ module Users
|
||||||
errors = []
|
errors = []
|
||||||
|
|
||||||
if champs_params[:dossier]
|
if champs_params[:dossier]
|
||||||
# FIXME: remove after migration
|
@dossier.assign_attributes(champs_params[:dossier])
|
||||||
dossier_params = champs_params[:dossier]
|
|
||||||
if dossier_params.key?(:champs_attributes)
|
|
||||||
dossier_params[:champs_public_attributes] = dossier_params.delete(:champs_attributes)
|
|
||||||
end
|
|
||||||
@dossier.assign_attributes(dossier_params)
|
|
||||||
# FIXME: in some cases a removed repetition bloc row is submitted.
|
# FIXME: in some cases a removed repetition bloc row is submitted.
|
||||||
# In this case it will be treated as a new record, and the action will fail.
|
# In this case it will be treated as a new record, and the action will fail.
|
||||||
@dossier.champs_public.filter(&:block?).each do |champ|
|
@dossier.champs_public.filter(&:block?).each do |champ|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
# type_de_champ_id :integer
|
# type_de_champ_id :integer
|
||||||
#
|
#
|
||||||
class Champs::RepetitionChamp < Champ
|
class Champs::RepetitionChamp < Champ
|
||||||
accepts_nested_attributes_for :champs, allow_destroy: true
|
accepts_nested_attributes_for :champs
|
||||||
delegate :libelle_for_export, to: :type_de_champ
|
delegate :libelle_for_export, to: :type_de_champ
|
||||||
|
|
||||||
def rows
|
def rows
|
||||||
|
|
Loading…
Reference in a new issue