Skip to content

Commit

Permalink
AO3-5578 Use rails_blob_url to allow ActiveStorage caching (#5009)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianjaustin authored Dec 31, 2024
1 parent e275257 commit e2d4b59
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit e2d4b59

Please sign in to comment.