[ActiveStorage] Add an option to automatically replace an existing attachment for has_one_attached


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: https://stackoverflow.com/questions/45870021/how-to-update-attachment-in-activestorage-rails-5-2/45933694#45933694

What do you think?