Clarify dependent relationships between etablissement and entreprise

This commit is contained in:
Paul Chavard 2018-03-07 17:42:31 +01:00
parent d5f620a163
commit 19b58a298c
3 changed files with 2 additions and 3 deletions

View file

@ -181,7 +181,6 @@ class Dossier < ApplicationRecord
def reset!
etablissement.destroy
entreprise.destroy
update_columns(autorisation_donnees: false)
end

View file

@ -1,6 +1,6 @@
class Entreprise < ApplicationRecord
belongs_to :dossier
has_one :etablissement, dependent: :destroy
has_one :etablissement
has_one :rna_information, dependent: :destroy
validates :siren, presence: true

View file

@ -1,6 +1,6 @@
class Etablissement < ApplicationRecord
belongs_to :dossier
belongs_to :entreprise
belongs_to :entreprise, dependent: :destroy
has_many :exercices, dependent: :destroy