Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AO3-5578 Use rails_blob_url to allow ActiveStorage caching #5009

Merged
merged 1 commit into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/helpers/collections_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/skins_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/users_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading