From e045215db7e38b0318b06aa62892e7241aa5095a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 30 Sep 2015 18:59:51 +0000 Subject: Remove attachment after transaction commit (#20388). Patch by Ivan Zabrovskiy. git-svn-id: http://svn.redmine.org/redmine/trunk@14630 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/attachment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models') diff --git a/app/models/attachment.rb b/app/models/attachment.rb index d1d7c6dd0..5fa89ee5a 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -53,7 +53,7 @@ class Attachment < ActiveRecord::Base @@thumbnails_storage_path = File.join(Rails.root, "tmp", "thumbnails") before_create :files_to_final_location - after_destroy :delete_from_disk + after_commit :delete_from_disk, :on => :destroy # Returns an unsaved copy of the attachment def copy(attributes=nil) -- cgit v1.2.3