Let Context Fail if there are any stages already in the tournament
This commit is contained in:
parent
548d9241c4
commit
83cd4ed340
|
|
@ -6,7 +6,7 @@ class AddGroupStageToTournament
|
|||
def call
|
||||
tournament = context.tournament
|
||||
groups = context.groups
|
||||
context.fail! if tournament.stages.size > 1
|
||||
context.fail! unless tournament.stages.empty?
|
||||
if (group_stage = GroupStageService.generate_group_stage(groups))
|
||||
tournament.stages = [group_stage]
|
||||
context.tournament = tournament
|
||||
|
|
|
|||
Loading…
Reference in New Issue