mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-20 06:02:39 +00:00
Moved poolNumber generation to weight.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class Wrestler < ActiveRecord::Base
|
||||
belongs_to :school
|
||||
belongs_to :weight
|
||||
attr_accessor :matches_all, :isWrestlingThisRound, :boutByRound, :seasonWinPercentage
|
||||
attr_accessor :matches_all, :isWrestlingThisRound, :boutByRound, :seasonWinPercentage, :poolNumber
|
||||
|
||||
def isWrestlingThisRound(matchRound)
|
||||
@gMatches = Match.where(g_id: self.id, round: matchRound)
|
||||
@@ -14,6 +14,11 @@ class Wrestler < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def generatePoolNumber
|
||||
@pool = self.weight.returnPoolNumber(self)
|
||||
return @pool
|
||||
end
|
||||
|
||||
def boutByRound(round,matches)
|
||||
@matches = matches.select{|m| m.w1 == self.id || m.w2 == self.id}
|
||||
@match = @matches.select{|m| m.round == round}.first
|
||||
|
||||
Reference in New Issue
Block a user