1
0
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:
2015-03-17 09:06:21 -04:00
parent d6a9abffac
commit c86f678fd1
7 changed files with 98 additions and 71 deletions

View File

@@ -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