Merge pull request #76 from turniere/ticket/TUR-9
Manually sort position of groups of 4 teams
This commit is contained in:
commit
1598db7796
|
|
@ -17,6 +17,13 @@ class GroupStageService
|
|||
group_scores: team_array.map { |team| GroupScore.new team: team }
|
||||
end
|
||||
|
||||
def deal_with_spacing_of_teams(matches, team_size)
|
||||
return unless team_size == 4
|
||||
|
||||
matches[2].position, matches[4].position = matches[4].position, matches[2].position
|
||||
matches
|
||||
end
|
||||
|
||||
def generate_all_matches_between(teams)
|
||||
matches = []
|
||||
teams.combination(2).to_a # = matchups
|
||||
|
|
@ -29,7 +36,7 @@ class GroupStageService
|
|||
]
|
||||
matches << match
|
||||
end
|
||||
matches
|
||||
deal_with_spacing_of_teams(matches, teams.size)
|
||||
end
|
||||
|
||||
# Updates all group_scores of the given group
|
||||
|
|
|
|||
Loading…
Reference in New Issue