Overwriting attached URL with object already in storage?

Hello! Thanks for making such a great tool!

I have a storage bucket (in google cloud storage) where I am externally placing storage objects and files. I was wondering if it’s possible to overwrite or replace the URL of a file without having to re-upload back into the same storage bucket when you re-attach or replace.

In other words, the file location that I intend to save on the model (e.g. “http://storage.google.com/myfile.png”) is already there, and I just want to save that new location.

I took a look at the attacher docs (https://github.com/shrinerb/shrine/blob/master/doc/attacher.md) and couldn’t seem to find a clear way of doing this without triggering another upload.

You can do this with Attacher#set or Attacher#change methods, which are shown in this section:

file = Shrine.uploaded_file(storage: :store, id: "myfile.png")

photo.image_attacher.set(file)

Ah, appreciate it! Thanks!