Prevent page refreshes when posting comments/descriptions with attachments

This commit is contained in:
Jorge Manrubia
2025-11-13 16:03:48 +01:00
parent 0267223749
commit e8920ceb0e
@@ -0,0 +1,17 @@
# Avoid page refreshes from Active Storage analyzing blobs when these are attached.
#
# A better option would be to disable touching with +touch_attachment_records+ but
# there is currently a bug https://github.com/rails/rails/issues/55144
module ActiveStorageAnalyzeJobSuppressBroadcasts
def perform(blob)
Board.suppressing_turbo_broadcasts do
Card.suppressing_turbo_broadcasts do
super
end
end
end
end
ActiveSupport.on_load :active_storage_blob do
ActiveStorage::AnalyzeJob.prepend ActiveStorageAnalyzeJobSuppressBroadcasts
end