Save match position

This commit is contained in:
Thor77 2019-05-10 12:52:49 +02:00 committed by Malaber
parent 0233ecab2c
commit 9c6b7422bd
1 changed files with 4 additions and 1 deletions

View File

@ -25,7 +25,10 @@ FactoryBot.define do
stage.matches = create_list(:running_playoff_match,
evaluator.match_count == -1 ? 2**stage.level : evaluator.match_count,
state: evaluator.match_state)
stage.matches.each_with_index { |match, i| match.position = i }
stage.matches.each_with_index do |match, i|
match.position = i
match.save
end
end
end
end