From 42d9b0957f4798273da49baca5762f3de9e0f001 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Fri, 10 May 2019 12:52:49 +0200 Subject: [PATCH] Save match position --- spec/factories/stages.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/factories/stages.rb b/spec/factories/stages.rb index 13c2e65..a8e55b9 100644 --- a/spec/factories/stages.rb +++ b/spec/factories/stages.rb @@ -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