destroy export_templates when destroy groupe_instructeur

This commit is contained in:
Christophe Robillard 2024-10-15 11:18:58 +02:00
parent e7080c1ad1
commit 47a4f40939
No known key found for this signature in database
GPG key ID: B417C2B0DE242D26

View file

@ -11,7 +11,7 @@ class GroupeInstructeur < ApplicationRecord
has_many :batch_operations, through: :dossiers, source: :batch_operations
has_many :assignments, class_name: 'DossierAssignment', dependent: :nullify, inverse_of: :groupe_instructeur
has_many :previous_assignments, class_name: 'DossierAssignment', dependent: :nullify, inverse_of: :previous_groupe_instructeur
has_many :export_templates
has_many :export_templates, dependent: :destroy
has_and_belongs_to_many :exports, dependent: :destroy
has_one :defaut_procedure, -> { with_discarded }, class_name: 'Procedure', foreign_key: :defaut_groupe_instructeur_id, dependent: :nullify, inverse_of: :defaut_groupe_instructeur