Merge pull request #1849 from rockandror/documentable-fix

Documentable fix
This commit is contained in:
BertoCQ
2017-09-19 17:07:25 +02:00
committed by GitHub
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