1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-07 06:54:16 +00:00

Use turbo streams for the bout board instead of auto refreshing every 30 seconds.

This commit is contained in:
2026-02-20 19:20:33 -05:00
parent dc50efe8fc
commit 654cb84827
14 changed files with 324 additions and 87 deletions

View File

@@ -17,6 +17,7 @@ class Match < ApplicationRecord
# update mat show with correct match if bout board is reset
# this is done with a turbo stream
after_commit :broadcast_mat_assignment_change, if: :saved_change_to_mat_id?, on: [:create, :update]
after_commit :broadcast_up_matches_board, on: :update, if: :saved_change_to_mat_id?
# Enqueue advancement and related actions after the DB transaction has committed.
# Using after_commit ensures any background jobs enqueued inside these callbacks
@@ -371,4 +372,8 @@ class Match < ApplicationRecord
)
end
end
def broadcast_up_matches_board
Tournament.broadcast_up_matches_board(tournament_id)
end
end