Change .map to .each

This commit is contained in:
Daniel Schädler 2019-05-15 09:00:51 +02:00
parent dcb19461be
commit d548eee245
1 changed files with 10 additions and 12 deletions

View File

@ -27,18 +27,16 @@ FactoryBot.define do
end end
after(:create) do |tournament, evaluator| after(:create) do |tournament, evaluator|
# this is basically a manual create_list as we need to count up the level of the stage # this is basically a manual create_list as we need to count up the level of the stage
levels = 1..evaluator.stage_count (1..evaluator.stage_count).each do |level|
tournament.stages << create(:playoff_stage,
tournament.stages.concat(levels.map do |level| level: level,
create(:playoff_stage, match_count: -1,
level: level, match_type: if evaluator.stage_count
match_count: -1, :running_playoff_match
match_type: if evaluator.stage_count else
:running_playoff_match :empty_prepared_playoff_match
else end)
:empty_prepared_playoff_match end
end)
end)
end end
factory :group_stage_tournament do factory :group_stage_tournament do