Hi there and first of all thank you for the good work you’re doing with shrine!
I have some trouble wrapping my head around something so I thought, I’ll ask here.
Here’s what I want to do:
- I have two different storage backends (filesystem, git)
- When a user uploads file A to the filesystem backend and updates this item later, I want to keep both files (A1 and A2) for version auditing.
- When a user uploads file A to the git backend and updates it later, I want to overwrite it as git takes care of the file versioning for me.
I’ve seen Customize file name and created a custom Uploader with a
generate_location method that can do this for me.
But this uploader only puts the files in the
:cache storage. At a later point in the flow, I’d like to use
attacher = Attacher.from_data(id: 'my_filename', storage: :cache) attacher.promote(storage: :git_storage)
The last step (
attacher.promote) somehow keeps creating a new filename. I don’t know where to hook into shrine in order to keep it from doing that or (ideally) provide the new name myself.