From 47a4f40939d3a6c3a7b2b5bea00f7adc826f312b Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Tue, 15 Oct 2024 11:18:58 +0200 Subject: [PATCH] destroy export_templates when destroy groupe_instructeur --- app/models/groupe_instructeur.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/groupe_instructeur.rb b/app/models/groupe_instructeur.rb index 370dd69c9..b717090f8 100644 --- a/app/models/groupe_instructeur.rb +++ b/app/models/groupe_instructeur.rb @@ -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