From 707ea37b33c694308667fe9cb19344f8cc9eaee0 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 27 Jul 2022 17:27:10 +0200 Subject: [PATCH] chore(sentry): tag dossier & procedure ids on dossier endpoints --- app/controllers/users/dossiers_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index a0e7b8f13..cbeae0320 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -389,7 +389,13 @@ module Users end def dossier - @dossier ||= dossier_scope.find(params[:id] || params[:dossier_id]) + @dossier ||= dossier_scope.find(params[:id] || params[:dossier_id]).tap do |dossier| + # Ease search & groupments by tags + Sentry.configure_scope do |scope| + scope.set_tags(procedure: dossier.procedure.id) + scope.set_tags(dossier: dossier.id) + end + end end def dossier_with_champs