From 4b11e78b89a0643f79a26359d60571cb79303992 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 5 Dec 2014 15:42:07 +0800 Subject: [PATCH] =?UTF-8?q?#1630=20=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E5=90=8C=E6=97=B6=E5=9C=A8=E7=A1=AC=E7=9B=98=E5=92=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E4=B8=8A=E5=88=A0=E9=99=A4=E8=AF=A5?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 111ec2cca..ecf6fe049 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -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 + @attachment.destroy respond_to do |format| if !@attachment.container.nil? &&