mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-04 05:43:47 +00:00
Extras do not score points but still get tie breaker criteria
This commit is contained in:
@@ -130,10 +130,10 @@ class PoolOrder
|
||||
def teamPoints
|
||||
pointsArray = []
|
||||
wrestlersWithSamePoints.each do |w|
|
||||
pointsArray << w.totalTeamPoints
|
||||
pointsArray << w.teamPointsEarned
|
||||
end
|
||||
mostPoints = pointsArray.max
|
||||
wrestlersWithLeastDeductedPoints = wrestlersWithSamePoints.select{|w| w.totalTeamPoints == mostPoints}
|
||||
wrestlersWithLeastDeductedPoints = wrestlersWithSamePoints.select{|w| w.teamPointsEarned == mostPoints}
|
||||
addPointsToWrestlersAhead(wrestlersWithLeastDeductedPoints.first)
|
||||
wrestlersWithLeastDeductedPoints.each do |wr|
|
||||
addPoints(wr)
|
||||
|
||||
@@ -16,7 +16,11 @@ class Wrestler < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def totalTeamPoints
|
||||
teamPointsEarned - totalDeductedPoints
|
||||
if self.extra
|
||||
return 0
|
||||
else
|
||||
teamPointsEarned - totalDeductedPoints
|
||||
end
|
||||
end
|
||||
|
||||
def teamPointsEarned
|
||||
|
||||
Reference in New Issue
Block a user