mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-06 14:36:59 +00:00
A BYE gives 2 points in a pool of you win one pool match. Now have two tests failing with regard to tie breakers. Most likely poorley written tests
This commit is contained in:
@@ -124,6 +124,14 @@ class Wrestler < ActiveRecord::Base
|
||||
pool_matches = allMatches.select{|m| m.bracket_position == "Pool"}
|
||||
pool_matches.select{|m| m.poolNumber == self.generatePoolNumber}
|
||||
end
|
||||
|
||||
def hasAPoolBye
|
||||
if weight.poolRounds(allMatches) > poolMatches.size
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
def championshipAdvancementWins
|
||||
matchesWon.select{|m| m.bracket_position == "Quarter" or m.bracket_position == "Semis"}
|
||||
|
||||
@@ -34,7 +34,11 @@ class CalculateWrestlerTeamScore
|
||||
|
||||
def poolPoints
|
||||
if @tournament.tournament_type == "Pool to bracket"
|
||||
(@wrestler.poolWins.size * 2)
|
||||
if @wrestler.poolWins.size >= 1 and @wrestler.hasAPoolBye == true
|
||||
((@wrestler.poolWins.size * 2) + 2)
|
||||
else
|
||||
(@wrestler.poolWins.size * 2)
|
||||
end
|
||||
else
|
||||
0
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user