Merge pull request #5254 from betagouv/dependent_destroy_for_exports

add destroy dependent option for exports
This commit is contained in:
krichtof 2020-06-11 12:43:21 +02:00 committed by GitHub
commit 4af64d2bc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@ class GroupeInstructeur < ApplicationRecord
has_many :assign_tos, dependent: :destroy
has_many :instructeurs, through: :assign_tos
has_many :dossiers
has_and_belongs_to_many :exports
has_and_belongs_to_many :exports, dependent: :destroy
validates :label, presence: { message: 'doit être renseigné' }, allow_nil: false
validates :label, uniqueness: { scope: :procedure, message: 'existe déjà' }