mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-18 21:42:16 +00:00
16 lines
291 B
Ruby
16 lines
291 B
Ruby
class MatScoreboardChannel < ApplicationCable::Channel
|
|
def subscribed
|
|
@mat = Mat.find_by(id: params[:mat_id])
|
|
return reject unless @mat
|
|
|
|
stream_for @mat
|
|
transmit(scoreboard_payload(@mat))
|
|
end
|
|
|
|
private
|
|
|
|
def scoreboard_payload(mat)
|
|
mat.scoreboard_payload
|
|
end
|
|
end
|