diff --git a/app/models/group_score.rb b/app/models/group_score.rb index 8fc6dad..72c3ab8 100644 --- a/app/models/group_score.rb +++ b/app/models/group_score.rb @@ -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 } diff --git a/app/services/group_stage_service.rb b/app/services/group_stage_service.rb index e6b688d..48bee72 100644 --- a/app/services/group_stage_service.rb +++ b/app/services/group_stage_service.rb @@ -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