Fix CacheBuster being queued for missing media attachments (#34253)

This commit is contained in:
Claire 2025-03-24 09:58:15 +01:00 committed by KMY
parent f9b715ca62
commit b84d2fc860
2 changed files with 11 additions and 0 deletions

View file

@ -425,6 +425,8 @@ class MediaAttachment < ApplicationRecord
@paths_to_cache_bust = MediaAttachment.attachment_definitions.keys.flat_map do |attachment_name|
attachment = public_send(attachment_name)
next if attachment.blank?
styles = DEFAULT_STYLES | attachment.styles.keys
styles.map { |style| attachment.url(style) }
end.compact