Skip to content

Commit 2aa316a

Browse files
committed
Reload detached attachments (#32922).
Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@20927 e93f8b46-1217-0410-a6f0-8f06a7374b81
1 parent ab31281 commit 2aa316a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,7 @@ def attach_saved_attachments
125125

126126
def detach_saved_attachments
127127
saved_attachments.each do |attachment|
128-
# TODO: use #reload instead, after upgrading to Rails 5
129-
# (after_rollback is called when running transactional tests in Rails 4)
130-
attachment.container = nil
128+
attachment.reload
131129
end
132130
end
133131

0 commit comments

Comments
 (0)