diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 3a17e04a7..47a28e823 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -287,8 +287,8 @@ class Dossier < ActiveRecord::Base end def reset! - entreprise.destroy etablissement.destroy + entreprise.destroy update_attributes(autorisation_donnees: false) end diff --git a/app/models/type_de_champ.rb b/app/models/type_de_champ.rb index 91ae22e30..027c6cf13 100644 --- a/app/models/type_de_champ.rb +++ b/app/models/type_de_champ.rb @@ -28,7 +28,7 @@ class TypeDeChamp < ActiveRecord::Base before_validation :change_header_section_mandatory def self.type_de_champs_list_fr - type_champs.map { |champ| [ I18n.t("activerecord.attributes.type_de_champ.type_champs.#{champ.last}"), champ.first ] } + type_champs.map { |champ| [I18n.t("activerecord.attributes.type_de_champ.type_champs.#{champ.last}"), champ.first] } end def field_for_list? @@ -37,5 +37,6 @@ class TypeDeChamp < ActiveRecord::Base def change_header_section_mandatory self.mandatory = false if self.type_champ == 'header_section' + true end end \ No newline at end of file