mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
69 lines
823 B
Ruby
69 lines
823 B
Ruby
class School < ActiveRecord::Base
|
|
belongs_to :tournament
|
|
has_many :wrestlers, dependent: :destroy
|
|
has_many :deductedPoints, through: :wrestlers
|
|
|
|
|
|
#calculate score here
|
|
def score
|
|
#Add score per wrestler. Calculate score in wrestler model.
|
|
return 0
|
|
end
|
|
|
|
def calcScore
|
|
#calc and save score
|
|
end
|
|
|
|
def totalDeductedPoints
|
|
points = 0
|
|
self.deductedPoints.each do |d|
|
|
points = points + d.points
|
|
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
|