Actions
Feature #21125
closedRemoving attachment after rollback transaction
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Description
I want to extend my previous issue #20388 about transaction in Attachment. There is second case, then we can have a problem. We can save file on disk, but rollback a transaction with creation of Attachment record. In this case we obtain ghost files without link with Attachment. In long term it leads to pollution of file storage.
I fix this situation on one of my plugin by follows way:
after_rollback :delete_from_disk, on: :create
Hope, this can be useful for Redmine.
Actions