diff --git a/app/controllers/gestionnaires/dossiers_controller.rb b/app/controllers/gestionnaires/dossiers_controller.rb index d7f7d06fa..02512b173 100644 --- a/app/controllers/gestionnaires/dossiers_controller.rb +++ b/app/controllers/gestionnaires/dossiers_controller.rb @@ -143,7 +143,7 @@ module Gestionnaires def purge_champ_piece_justificative @champ = dossier.champs_private.find(params[:champ_id]) - @champ.piece_justificative_file.purge + @champ.piece_justificative_file.purge_later flash.notice = 'La pièce jointe a bien été supprimée.' end diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 9f3bce5e9..420a81891 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -239,7 +239,7 @@ module Users def purge_champ_piece_justificative @champ = dossier.champs.find(params[:champ_id]) - @champ.piece_justificative_file.purge + @champ.piece_justificative_file.purge_later flash.notice = 'La pièce jointe a bien été supprimée.' end diff --git a/app/models/champs/piece_justificative_champ.rb b/app/models/champs/piece_justificative_champ.rb index 00ec3a559..27bda0eb8 100644 --- a/app/models/champs/piece_justificative_champ.rb +++ b/app/models/champs/piece_justificative_champ.rb @@ -40,7 +40,7 @@ class Champs::PieceJustificativeChamp < Champ end if errors.present? - piece_justificative_file.purge + piece_justificative_file.purge_later end errors