turniere-backend/app/services/team_action_list_broadcast.rb

16 lines
409 B
Ruby

# frozen_string_literal: true
class TeamActionListBroadcast
class << self
def call(tournament_id)
tournament = Tournament.includes(team_action_lists: { team_action_items: :team }).find_by(id: tournament_id)
return if tournament.nil?
TournamentTeamActionListsChannel.broadcast_to(
tournament,
TeamActionListBroadcastPayload.build(tournament)
)
end
end
end