rootstrap / active-storage-base64

Base64 support for ActiveStorage
https://rootstrap.com
MIT License
160 stars 16 forks source link

[FEATURE] Support Rails7 model varients #68

Closed tarellel closed 2 years ago

tarellel commented 2 years ago

Using the rails7 model variants errors out the app.

# model
has_one_base64_attached :avatar do |attachable|
   attachable.variant :thumb, resize: "100x100"
end

# view
image_tag(@user&.avatar&.variant(:thumb), class: 'inline-block h-7 w-7 rounded-full', loading: 'lazy')

Only the current rails 6 method works to create a variant when pulling the attachment in a view.

image_tag(@user&.avatar&.variant(format: :jpg, strip: true, quality: 80, resize_to_fill: [@size, @size]), class: 'inline-block h-7 w-7 rounded-full', loading: 'lazy')
AhmedKamal20 commented 2 years ago

does even v1.2.0 support rails 7 now?

santib commented 2 years ago

does even v1.2.0 support rails 7 now?

@AhmedKamal20 no, I'm about to release v2.0.0 with support to rails 7 soon 😄 see https://github.com/rootstrap/active-storage-base64/pull/69

santib commented 2 years ago

@tarellel @AhmedKamal20 I just published v2.0.0 of the gem with support for Rails 7. Enjoy 😄

tarellel commented 2 years ago

@santib Thank you very much, that was quite an amazing turn around.