Fix incorrect URL being used when cache busting (#34189)
This commit is contained in:
@@ -421,7 +421,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
|
||||
|
||||
@@ -95,7 +95,7 @@ class SuspendAccountService < BaseService
|
||||
end
|
||||
end
|
||||
|
||||
CacheBusterWorker.perform_async(attachment.path(style)) if Rails.configuration.x.cache_buster_enabled
|
||||
CacheBusterWorker.perform_async(attachment.url(style)) if Rails.configuration.x.cache_buster_enabled
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -91,7 +91,7 @@ class UnsuspendAccountService < BaseService
|
||||
end
|
||||
end
|
||||
|
||||
CacheBusterWorker.perform_async(attachment.path(style)) if Rails.configuration.x.cache_buster_enabled
|
||||
CacheBusterWorker.perform_async(attachment.url(style)) if Rails.configuration.x.cache_buster_enabled
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user