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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user