Let Context Fail if there are any stages already in the tournament
This commit is contained in:
parent
161e46978d
commit
a47cee64f0
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue