Clarify dependent relationships between etablissement and entreprise
This commit is contained in:
parent
d5f620a163
commit
19b58a298c
3 changed files with 2 additions and 3 deletions
|
@ -181,7 +181,6 @@ class Dossier < ApplicationRecord
|
||||||
|
|
||||||
def reset!
|
def reset!
|
||||||
etablissement.destroy
|
etablissement.destroy
|
||||||
entreprise.destroy
|
|
||||||
|
|
||||||
update_columns(autorisation_donnees: false)
|
update_columns(autorisation_donnees: false)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class Entreprise < ApplicationRecord
|
class Entreprise < ApplicationRecord
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
has_one :etablissement, dependent: :destroy
|
has_one :etablissement
|
||||||
has_one :rna_information, dependent: :destroy
|
has_one :rna_information, dependent: :destroy
|
||||||
|
|
||||||
validates :siren, presence: true
|
validates :siren, presence: true
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class Etablissement < ApplicationRecord
|
class Etablissement < ApplicationRecord
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
belongs_to :entreprise
|
belongs_to :entreprise, dependent: :destroy
|
||||||
|
|
||||||
has_many :exercices, dependent: :destroy
|
has_many :exercices, dependent: :destroy
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue