From f6d8752e442cf1b4fa7c5004c86b9597ff8e94b1 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Wed, 3 Mar 2010 17:04:50 +0000 Subject: [PATCH] Fixes destroying attachments if the update fails. (r2875 r3523) git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3526 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/issues_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 4ac11162c..1bbd9b739 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -213,7 +213,7 @@ class IssuesController < ApplicationController # Optimistic locking exception flash.now[:error] = l(:notice_locking_conflict) # Remove the previously added attachments if issue was not updated - attachments.each(&:destroy) + attachments[:files].each(&:destroy) if attachments[:files] end def reply