[ActiveStorage] Option to delete file on cloud storage service later

I would like an option in Active Storage to delay the deletion of a file from the cloud storage service for, say, a month.

My use case is that I am using Active Storage to store documents for customers and want to be able to recover in the event of accidental deletion of said documents. I can roll back our database from backups but obviously document content stored on S3/GCS is still gone. Versioning on the S3/GCS bucket doesn’t cut it.

I’m willing to have a go at implementing this since it seems simple enough, but I’m not familiar with Rails’ codebase so it may take me longer than I’d like. Before I start, is this a really stupid idea?


Actually it turns out that S3’s lifecycle policy feature covers my needs so I’m no longer considering this. It looks crazy anyway.