diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index ecf6fe049..34dfca75f 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -203,7 +203,11 @@ class AttachmentsController < ApplicationController if @attachment.container.respond_to?(:init_journal) @attachment.container.init_journal(User.current) end - @attachment.destroy + if @attachment.container + @attachment.container.attachments.delete(@attachment) + else + @attachment.destroy + end respond_to do |format| if !@attachment.container.nil? &&