ancient-kitchen-45632
09/13/2023, 4:41 AMminiature-optician-85831
09/13/2023, 4:41 AMancient-kitchen-45632
09/13/2023, 4:42 AMhttps://cdn.discordapp.com/attachments/1151377099274326016/1151377325053722644/Screenshot_2023-09-13_at_4.42.12_PM.png▾
loud-jewelry-99127
09/13/2023, 4:42 AMloud-jewelry-99127
09/13/2023, 4:43 AMvalue.variant(:thumb)
and value
are always returning what expected?ancient-kitchen-45632
09/13/2023, 4:45 AMancient-kitchen-45632
09/13/2023, 4:46 AMancient-kitchen-45632
09/13/2023, 4:46 AMloud-jewelry-99127
09/13/2023, 4:48 AMActiveStorage::Attached::One
and you're returning ActiveStorage::VariantWithRecord
ancient-kitchen-45632
09/13/2023, 4:48 AMloud-jewelry-99127
09/13/2023, 4:52 AMvalue.variant(:thumb).blob
?ancient-kitchen-45632
09/13/2023, 4:53 AMloud-jewelry-99127
09/13/2023, 4:53 AMloud-jewelry-99127
09/13/2023, 4:54 AMloud-jewelry-99127
09/13/2023, 4:54 AMloud-jewelry-99127
09/13/2023, 4:54 AMruby
format_using: -> {
if value.attached? && view == :show
value.blob = value.variant(:thumb).blob
end
value
}
ancient-kitchen-45632
09/13/2023, 4:57 AMloud-jewelry-99127
09/13/2023, 4:58 AMancient-kitchen-45632
09/13/2023, 4:58 AMancient-kitchen-45632
09/13/2023, 5:05 AMancient-kitchen-45632
09/13/2023, 5:05 AMloud-jewelry-99127
09/13/2023, 5:05 AMloud-jewelry-99127
09/13/2023, 5:06 AMhttps://cdn.discordapp.com/attachments/1151377099274326016/1151383251680755723/image.png▾
loud-jewelry-99127
09/13/2023, 5:06 AMloud-jewelry-99127
09/13/2023, 5:06 AMloud-jewelry-99127
09/13/2023, 5:07 AMancient-kitchen-45632
09/13/2023, 5:07 AMancient-kitchen-45632
09/13/2023, 5:08 AMloud-jewelry-99127
09/13/2023, 5:08 AMancient-kitchen-45632
09/13/2023, 5:08 AMloud-jewelry-99127
09/13/2023, 5:09 AMancient-kitchen-45632
09/13/2023, 5:09 AMancient-kitchen-45632
09/13/2023, 5:09 AMancient-kitchen-45632
09/13/2023, 5:10 AMloud-jewelry-99127
09/13/2023, 5:11 AMancient-kitchen-45632
09/13/2023, 5:12 AMloud-jewelry-99127
09/13/2023, 5:13 AMloud-jewelry-99127
09/13/2023, 5:13 AMloud-jewelry-99127
09/13/2023, 5:15 AMruby
field :profile_pic, as: :file do |model, resource, view|
profile_pic = model.profile_pic
if profile_pic.attached? && view == :show
profile_pic.blob = profile_pic.variant(:thumb).blob
end
profile_pic
end
loud-jewelry-99127
09/13/2023, 5:15 AMancient-kitchen-45632
09/13/2023, 5:20 AMancient-kitchen-45632
09/13/2023, 5:20 AMloud-jewelry-99127
09/13/2023, 5:21 AMloud-jewelry-99127
09/13/2023, 5:21 AMancient-kitchen-45632
09/13/2023, 5:26 AMancient-kitchen-45632
09/13/2023, 5:26 AMancient-kitchen-45632
09/13/2023, 5:39 AMloud-jewelry-99127
09/13/2023, 5:40 AMloud-jewelry-99127
09/13/2023, 5:40 AMloud-jewelry-99127
09/13/2023, 5:40 AMancient-kitchen-45632
09/13/2023, 5:42 AMancient-kitchen-45632
09/13/2023, 5:43 AMancient-kitchen-45632
09/13/2023, 5:43 AMloud-jewelry-99127
09/13/2023, 5:44 AMloud-jewelry-99127
09/19/2023, 4:07 AMformat_using: -> { value.variant(resize_to_limit: [100, 100]).processed.image }
on the issue I created arround this problem. I tested it and it works, the styles are forcing the image to expand with low res anyway but we'll fix it on future releases.loud-jewelry-99127
10/10/2023, 2:21 PMformat_using: -> { value.variant(resize_to_limit: [100, 100]).processed.image }
and the image will respect the resizing