From ca496568200b8ebe9f157bd020a46bd170237a78 Mon Sep 17 00:00:00 2001 From: Brian Austin Date: Mon, 30 Dec 2024 22:41:01 -0500 Subject: [PATCH] AO3-5578 Use rails_blob_url to allow ActiveStorage caching --- app/helpers/collections_helper.rb | 2 +- app/helpers/skins_helper.rb | 4 ++-- app/helpers/users_helper.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/collections_helper.rb b/app/helpers/collections_helper.rb index 27a94249848..d1c8af19837 100644 --- a/app/helpers/collections_helper.rb +++ b/app/helpers/collections_helper.rb @@ -128,7 +128,7 @@ def collection_item_approval_options(actor:, item_type:) def standard_icon_url(collection) return "/images/skins/iconsets/default/icon_collection.png" unless collection.icon.attached? - collection.icon.variant(:standard).processed.url + rails_blob_url(collection.icon.variant(:standard)) end # Wraps the collection's standard_icon_url in an image tag diff --git a/app/helpers/skins_helper.rb b/app/helpers/skins_helper.rb index 9c2f703b235..73bd2af9876 100644 --- a/app/helpers/skins_helper.rb +++ b/app/helpers/skins_helper.rb @@ -11,11 +11,11 @@ def skin_author_link(skin) def skin_preview_display(skin) return unless skin&.icon&.attached? - link_to image_tag(skin.icon.variant(:standard).processed.url, + link_to image_tag(rails_blob_url(skin.icon.variant(:standard)), alt: skin.icon_alt_text, class: "icon", skip_pipeline: true), - skin.icon.url + rails_blob_url(skin.icon) end # Fetches the current skin. This is determined by the following diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index f3252c781eb..f51e9e0aa2e 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -24,7 +24,7 @@ def print_pseuds(user) def standard_icon(pseud = nil) return "/images/skins/iconsets/default/icon_user.png" unless pseud&.icon&.attached? - pseud.icon.variant(:standard).processed.url + rails_blob_url(pseud.icon.variant(:standard)) end # no alt text if there isn't specific alt text