Remove position from comparison
This commit is contained in:
parent
1e899d9944
commit
5d857c5d82
|
|
@ -9,7 +9,7 @@ class GroupScore < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def <=>(other)
|
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?
|
if point_comparison.zero?
|
||||||
comparison_match = group.matches.find do |match|
|
comparison_match = group.matches.find do |match|
|
||||||
match.match_scores.any? { |match_score| match_score.team == team }
|
match.match_scores.any? { |match_score| match_score.team == team }
|
||||||
|
|
|
||||||
|
|
@ -111,12 +111,9 @@ class GroupStageService
|
||||||
advancing_teams
|
advancing_teams
|
||||||
end
|
end
|
||||||
|
|
||||||
# private
|
private
|
||||||
|
|
||||||
def recalculate_position_of_group_scores!(group_scores)
|
def recalculate_position_of_group_scores!(group_scores)
|
||||||
group_scores.each do |group_score|
|
|
||||||
group_score.position = 0
|
|
||||||
end
|
|
||||||
group_scores = group_scores.sort
|
group_scores = group_scores.sort
|
||||||
|
|
||||||
rank = 1
|
rank = 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue