Aggiunge i tornei con hub, pagina pubblica e tabellone per semifinali e finali.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
module Tournaments
|
||||
class EnsureBroadcastTeam
|
||||
def self.call(tournament)
|
||||
new(tournament).call
|
||||
end
|
||||
|
||||
def initialize(tournament)
|
||||
@tournament = tournament
|
||||
end
|
||||
|
||||
def call
|
||||
return @tournament.broadcast_team if @tournament.broadcast_team.present?
|
||||
|
||||
team = @tournament.club.teams.create!(
|
||||
name: @tournament.name,
|
||||
sport_key: @tournament.sport_key,
|
||||
internal_kind: Tournament::INTERNAL_TEAM_KIND
|
||||
)
|
||||
@tournament.update!(broadcast_team: team)
|
||||
team
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user