Remove document cached_attachment value after destroy_upload action.

This commit is contained in:
Senén Rodero Rodríguez
2017-09-11 14:39:58 +02:00
parent 90a5053ca8
commit 4c225aac62
2 changed files with 36 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ class DocumentsController < ApplicationController
def destroy_upload
@document = Document.new(cached_attachment: params[:path])
@document.set_attachment_from_cached_attachment
@document.cached_attachment = nil
@document.documentable = @documentable
if @document.attachment.destroy