Hi! I’m new to the community so I hope I’m going about this the right way.
I’d like to use different containers on Azure blob store for each attachment type that I have in ActiveStorage. I’m wondering what the community’s opinion is on this feature, and if it’s something I should invest some time in implementing, or create an issue for on Github.
For example, if you have a User model with an attached avatar
and a Post model with an attached image
, it would be nice to be able to store avatar
images in a container called “user-avatars” and image
images in a container called “post-images”.
This could be implemented either as a configuration option in the model, like:
has_one_attached :avatar, container: "user-avatars
Or in storage.yml, like:
azure:
service: ...
storage_account_name: ...
...
containers:
user:
avatar: user-avatars
post:
image: post-images
Honestly the former seems way preferable to me, but just trying to convey an idea of what the feature is.
This is useful to me because I’m working on a large Rails codebase with many terabytes of file attachments. I’m trying to do a low-impact migration from Paperclip, in which I initially don’t need to move all the attachments on Azure, but rather override Active Storage’s path logic to point to the proper container. In the process, I’m already monkey-patching some code to allow ActiveStorage to use the same paths Paperclip used. However, the issue of being able to support multiple containers is distinct enough from this effort that I thought it could be its own feature.