Remove position from comparison

This commit is contained in:
Daniel Schädler 2024-04-07 21:40:29 +02:00
parent 1e899d9944
commit 5d857c5d82
2 changed files with 2 additions and 5 deletions

View File

@ -9,7 +9,7 @@ class GroupScore < ApplicationRecord
end
def <=>(other)
point_comparison = [-position, -group_points, -difference_in_points, -scored_points] <=> [-other.position, -other.group_points, -other.difference_in_points, -other.scored_points]
point_comparison = [-group_points, -difference_in_points, -scored_points] <=> [-other.group_points, -other.difference_in_points, -other.scored_points]
if point_comparison.zero?
comparison_match = group.matches.find do |match|
match.match_scores.any? { |match_score| match_score.team == team }

View File

@ -111,12 +111,9 @@ class GroupStageService
advancing_teams
end
# private
private
def recalculate_position_of_group_scores!(group_scores)
group_scores.each do |group_score|
group_score.position = 0
end
group_scores = group_scores.sort
rank = 1