Refactor purge pj to be more generic

This commit is contained in:
Paul Chavard 2019-05-29 12:05:28 +02:00
parent 4013557cd7
commit ff44b7a600
13 changed files with 82 additions and 143 deletions

View file

@ -6,4 +6,11 @@ class AttachmentsController < ApplicationController
@attachment = @blob.attachments.find(params[:id])
@user_can_upload = params[:user_can_upload]
end
def destroy
attachment = @blob.attachments.find(params[:id])
@attachment_id = attachment.id
attachment.purge_later
flash.now.notice = 'La pièce jointe a bien été supprimée.'
end
end