Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I keep old files uploaded with active storage?

hcosteira asked in 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.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,584+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.