diff --git a/app/models/aircraft.rb b/app/models/aircraft.rb index 1053b55..9919af5 100644 --- a/app/models/aircraft.rb +++ b/app/models/aircraft.rb @@ -87,9 +87,10 @@ class Aircraft < ApplicationRecord def picture_shown? = picture.attached? && picture.attachment.persisted? # The photo at a page's size (:thumb or :card), or the original when it - # can't be resized (see ActiveStorage::Blob#resizable_image?). + # isn't a kind that can be resized. (One that can't be read is sent as the + # original too: see config/initializers/active_storage_images.rb.) def picture_for(size) - picture.blob.resizable_image? ? picture.variant(size) : picture + picture.variable? ? picture.variant(size) : picture end private diff --git a/app/views/squawks/_attachments.html.erb b/app/views/squawks/_attachments.html.erb index c569a27..161568f 100644 --- a/app/views/squawks/_attachments.html.erb +++ b/app/views/squawks/_attachments.html.erb @@ -2,8 +2,7 @@ (which has Download); other files open in a new tab and have a download link. %> <% files = squawk.attachments.to_a %> <% if files.any? %> - <%# Thumbnails for images that can be resized; others are listed as files. %> - <% photos, others = files.partition { _1.image? && _1.blob.resizable_image? } %> + <% photos, others = files.partition { _1.image? && _1.variable? } %>