Project

General

Profile

Actions

Feature #20388

closed

Removing attachment after commit transaction

Added by Ivan Zabrovskiy over 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Attachments
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

Now in Attachment model is

after_destroy :delete_from_disk

If you want to construct a serious logic with Rollback this behaviour leads to remove file from disk, but leave an attachment record in DB.
In my project I replaced this callback on

after_commit :delete_from_disk, on: :destroy

and it works perfect.

I think this is a good modification for Redmine. It have full backward compatibility but can extend ability for strong logic in app.

Actions

Also available in: Atom PDF