#1630 删除文件的同时在硬盘和数据库上删除该文件
This commit is contained in:
parent
2ce49c041b
commit
4b11e78b89
|
@ -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? &&
|
||||
|
|
Loading…
Reference in New Issue