Fix incorrect URL being used when cache busting (#34189)

This commit is contained in:
Claire 2025-03-17 17:40:28 +01:00 committed by KMY
parent 6a672ec227
commit f9b715ca62
5 changed files with 20 additions and 24 deletions

View file

@ -426,7 +426,7 @@ class MediaAttachment < ApplicationRecord
@paths_to_cache_bust = MediaAttachment.attachment_definitions.keys.flat_map do |attachment_name|
attachment = public_send(attachment_name)
styles = DEFAULT_STYLES | attachment.styles.keys
styles.map { |style| attachment.path(style) }
styles.map { |style| attachment.url(style) }
end.compact
rescue => e
# We really don't want any error here preventing media deletion