New Discussion

Notifications

You’re not receiving notifications from this thread.

How do I keep old files uploaded with active storage?

0
Rails

I'm using active storage with active_storage_db gem to keep files in Postgres instead of storing them in the cloud.
I have a document which I upload - has_one_attached (i don't need to upload multiple files at the same time). Everything works good. But then if I upload a new document I want to keep the other document to keep a record of how many documents have been uploaded and If I want to, I can download them. When I open the record of the document, the uploaded document will always be the latest one.

What happens now is every time I upload a new document, if there was already a document there, this document is replaced by the new one.

Thanks for the help.

Join the discussion
Create an account Log in

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.