From d548eee245efc6cc950a32f2637b998b34134c8d Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Wed, 15 May 2019 09:00:51 +0200 Subject: [PATCH] Change .map to .each --- spec/factories/tournaments.rb | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/spec/factories/tournaments.rb b/spec/factories/tournaments.rb index a24edf8..6320cde 100644 --- a/spec/factories/tournaments.rb +++ b/spec/factories/tournaments.rb @@ -27,18 +27,16 @@ FactoryBot.define do end after(:create) do |tournament, evaluator| # this is basically a manual create_list as we need to count up the level of the stage - levels = 1..evaluator.stage_count - - tournament.stages.concat(levels.map do |level| - create(:playoff_stage, - level: level, - match_count: -1, - match_type: if evaluator.stage_count - :running_playoff_match - else - :empty_prepared_playoff_match - end) - end) + (1..evaluator.stage_count).each do |level| + tournament.stages << create(:playoff_stage, + level: level, + match_count: -1, + match_type: if evaluator.stage_count + :running_playoff_match + else + :empty_prepared_playoff_match + end) + end end factory :group_stage_tournament do