models: delete AdministrateursProcedure when destroying Procedure
This commit is contained in:
parent
c2eab85a90
commit
a645c5781d
1 changed files with 1 additions and 1 deletions
|
@ -176,7 +176,7 @@ class Procedure < ApplicationRecord
|
||||||
end
|
end
|
||||||
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 :administrateurs, through: :administrateurs_procedures, after_remove: -> (procedure, _admin) { procedure.validate! }
|
||||||
has_many :groupe_instructeurs, dependent: :destroy
|
has_many :groupe_instructeurs, dependent: :destroy
|
||||||
has_many :instructeurs, through: :groupe_instructeurs
|
has_many :instructeurs, through: :groupe_instructeurs
|
||||||
|
|
Loading…
Reference in a new issue