]> source.dussan.org Git - redmine.git/commitdiff
Reload detached attachments (#32922).
authorGo MAEDA <maeda@farend.jp>
Thu, 8 Apr 2021 08:55:22 +0000 (08:55 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 8 Apr 2021 08:55:22 +0000 (08:55 +0000)
Patch by Pavel Rosický.

git-svn-id: http://svn.redmine.org/redmine/trunk@20927 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb

index 472cd4dad80755f7a6ba807873dff7b931104e04..32ab675c74d05df267fa839d6c8a1a2d985bacbf 100644 (file)
@@ -125,9 +125,7 @@ module Redmine
 
         def detach_saved_attachments
           saved_attachments.each do |attachment|
-            # TODO: use #reload instead, after upgrading to Rails 5
-            # (after_rollback is called when running transactional tests in Rails 4)
-            attachment.container = nil
+            attachment.reload
           end
         end