Merge pull request #8585 from colinux/fix-procedure-draft-delete-dossiers

fix(dossier/démarche en test): peut détruire des dossiers référencés dans des opérations de masse
This commit is contained in:
Colin Darie 2023-02-08 14:49:12 +01:00 committed by GitHub
commit ea51e7d3f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -7,6 +7,10 @@ module Administrateurs
id = params[:procedure_id] || params[:id]
@procedure = current_administrateur.procedures.find(id)
Sentry.configure_scope do |scope|
scope.set_tags(procedure: @procedure.id)
end
rescue ActiveRecord::RecordNotFound
flash.alert = 'Démarche inexistante'
redirect_to admin_procedures_path, status: 404

View file

@ -147,7 +147,7 @@ class Dossier < ApplicationRecord
belongs_to :user, optional: true
belongs_to :parent_dossier, class_name: 'Dossier', optional: true
belongs_to :batch_operation, optional: true
has_many :dossier_batch_operations
has_many :dossier_batch_operations, dependent: :destroy
has_many :batch_operations, through: :dossier_batch_operations
has_one :france_connect_information, through: :user