1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Tie breaker for team score

This commit is contained in:
2015-11-16 16:59:08 +00:00
parent 6436551f34
commit 328898f1e8
4 changed files with 83 additions and 49 deletions

View File

@@ -6,14 +6,21 @@ class School < ActiveRecord::Base
#calculate score here
def score
#Add score per wrestler. Calculate score in wrestler model.
return 0
calcScore
end
def calcScore
#calc and save score
totalWrestlerPoints - totalDeductedPoints
end
def totalWrestlerPoints
points = 0
self.wrestlers.each do |w|
points = points + w.totalTeamPoints
end
points
end
def totalDeductedPoints
points = 0
self.deductedPoints.each do |d|
@@ -21,48 +28,4 @@ class School < ActiveRecord::Base
end
points
end
def poolWins
end
def pinDefaultDqWins
end
def techFallWins
end
def majorWins
end
def firstPlace
end
def secondPlace
end
def thirdPlace
end
def fourthPlace
end
def fifthPlace
end
def sixthPlace
end
def seventhPlace
end
end