[ActiveStorage] add support for defining versions in models similar to paperclip

Hi,

I would like to add support for defining different versions of images for active storage.

Already started some development:

The diff is here: https://gist.github.com/igorkasyanchuk/2775123a3fbaf196f43a092e8f4a6931

and it could be used like

has_one_attached :avatar, versions: { thumb: { combine_options: {thumbnail: “500x500^”, gravity: “center”, extent: “500x500”} } }

``

is it fine? I’ve got a suggestion to implement it like this

has_one_attached :avatar do
  variation :thumb, thumbnail: "500x500^", gravity: "center", extent: "500x500"
end

which looks good to me.

What do you think?

I think this is a useful feature to add to Active Storage

Hey there!

Did you make any progress? I’d also want to see this feature at some point, and would like to implement it. But if you are already doing so, then no reason for wasted effort from my side.

Cheers

Hi, please implement it. Currently, I don’t have enough time to work on this feature. Thanks