Let Context Fail if there are any stages already in the tournament

This commit is contained in:
Daniel Schädler 2019-04-27 22:34:27 +02:00
parent 161e46978d
commit a47cee64f0
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ class AddGroupStageToTournament
def call def call
tournament = context.tournament tournament = context.tournament
groups = context.groups groups = context.groups
context.fail! if tournament.stages.size > 1 context.fail! unless tournament.stages.empty?
if (group_stage = GroupStageService.generate_group_stage(groups)) if (group_stage = GroupStageService.generate_group_stage(groups))
tournament.stages = [group_stage] tournament.stages = [group_stage]
context.tournament = tournament context.tournament = tournament