Hello,
Do you think it could make sense to add an option to has_one_attached
, so that any previous attachment is automatically purged (or purged later) when calling attach
?
The syntax could be:
has_one_attached :attachment, previous_attachment: { :purge | :purge_later | :restrict_with_error | :restrict_with_exception }
This follows the question posted here: activerecord - How to update attachment in ActiveStorage (Rails 5.2) - Stack Overflow
What do you think?