From a645c5781d01f22c020bccfaa2090a40f5b703a5 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Wed, 2 Mar 2022 12:09:35 +0100 Subject: [PATCH] models: delete AdministrateursProcedure when destroying Procedure --- app/models/procedure.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index d3be28e47..a7cc0e1a9 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -176,7 +176,7 @@ class Procedure < ApplicationRecord end end - has_many :administrateurs_procedures + has_many :administrateurs_procedures, dependent: :delete_all has_many :administrateurs, through: :administrateurs_procedures, after_remove: -> (procedure, _admin) { procedure.validate! } has_many :groupe_instructeurs, dependent: :destroy has_many :instructeurs, through: :groupe_instructeurs