Alejandro Sierra

Joined

60 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in Active Storage replace attached from a variant

I tried to do that in an before_save :default_values in the line:
self.update(image: self.image.variant(:thumb))
and I got this error message:

Could not find or build blob: expected attachable, got #true}, service_name: "local", byte_size: 213394, checksum: "kz1jimxJihCUHf7Ma+DLpw==", created_at: nil>, @variation=#"jpg", :resize_to_limit=>[200, 200]}>>

Posted in Active Storage replace attached from a variant

Following the example from the guide, I can create a variant as soon as I upload an image, but I want the main image, the attached blob to be that variant. How can I do it in an easy and clean way?