summaryrefslogtreecommitdiffstats
path: root/lib/plugins
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-04-08 08:55:22 +0000
committerGo MAEDA <maeda@farend.jp>2021-04-08 08:55:22 +0000
commit2aa316a3e47ad6690c186e91bd0cb9a754095c88 (patch)
tree709f0766ee6acf27433d9025c10d1c103b4b70fd /lib/plugins
parentab3128106e643bd0bfb720ebb96c1671a78d2822 (diff)
downloadredmine-2aa316a3e47ad6690c186e91bd0cb9a754095c88.tar.gz
redmine-2aa316a3e47ad6690c186e91bd0cb9a754095c88.zip
Reload detached attachments (#32922).
Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@20927 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
index 472cd4dad..32ab675c7 100644
--- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
+++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
@@ -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