Create :stage_tournaments with realistic match positions

This commit is contained in:
Daniel Schädler 2019-05-26 22:03:22 +02:00
parent 9f3fb532a5
commit a710addde7
1 changed files with 6 additions and 0 deletions

View File

@ -34,6 +34,12 @@ FactoryBot.define do
match_count: -1, match_count: -1,
match_type: evaluator.stage_count ? :running_playoff_match : :empty_prepared_playoff_match match_type: evaluator.stage_count ? :running_playoff_match : :empty_prepared_playoff_match
) )
tournament.stages.each do |stage|
stage.matches.each_with_index do |match, i|
match.position = i
match.save!
end
end
end end
end end