Closed mhmdAljefri closed 4 years ago
It is working for me
Versions: ruby 2.6.5 rails 6.0.1 active_storage_base64 1.0.0
would you mind providing your versions?
Versions:
ruby 2.6.0p0, rails (5.2.3), active_storage_base64 (0.1.4)
@santib :)
I think It's from rails version?
@mhmdAljefri Seems like it wasn't a problem with the versions. I was able to reproduce it by calling variant
to an empty attachment.
I don't think this is a bug introduced by the gem, I see the same error with has_one_attached
.
Example:
class User
has_one_base64_attached :avatar
has_one_attached :image
end
So I think you'll solve this issue by doing Model.avatar.variant(resize_to_limit: [100, 100]) if Model.avatar.attached?
I want to enable variants, like Rails Active Storage. Transforming Images Guide
I tried to add the processing image gem
image_processing
, then use variant method:expected behavior:
resized image
Current behavior:
Any help to implement this with ability of use base64 files