Manually create the list of stages to assign stage levels correctly
This commit is contained in:
parent
8785c2075d
commit
2601f0ae31
|
|
@ -17,7 +17,10 @@ FactoryBot.define do
|
||||||
stage_count { 1 }
|
stage_count { 1 }
|
||||||
end
|
end
|
||||||
after(:create) do |tournament, evaluator|
|
after(:create) do |tournament, evaluator|
|
||||||
tournament.stages = create_list(:stage, evaluator.stage_count)
|
# this is basically a manual create_list as we need to count up the level of the stage
|
||||||
|
tournament.stages.concat 1..evaluator.stage_count.map do |level|
|
||||||
|
create(:playoff_stage, level: level, match_count: -1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
factory :group_stage_tournament do
|
factory :group_stage_tournament do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue