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
committed by Bertocq
parent 630a3252b7
commit 6e3f9f9b32
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