#1630 删除文件的同时在硬盘和数据库上删除该文件

This commit is contained in:
sw 2014-12-05 15:42:07 +08:00
parent 2ce49c041b
commit 4b11e78b89
1 changed files with 1 additions and 6 deletions

View File

@ -203,12 +203,7 @@ class AttachmentsController < ApplicationController
if @attachment.container.respond_to?(:init_journal)
@attachment.container.init_journal(User.current)
end
if @attachment.container
# Make sure association callbacks are called
@attachment.container.attachments.delete(@attachment)
else
@attachment.destroy
end
respond_to do |format|
if !@attachment.container.nil? &&