1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-11 16:01:56 +00:00

Mock advancment from pools to brackets

This commit is contained in:
2015-10-08 17:31:27 -04:00
parent b449aa530b
commit 516dbe66ad
6 changed files with 92 additions and 3 deletions

View File

@@ -34,8 +34,25 @@ class Wrestler < ActiveRecord::Base
@matches = Match.where("w1 = ? or w2 = ?",self.id,self.id)
return @matches
end
def poolMatches
allMatches.select{|m| m.bracket_position == "Pool"}
end
def finishedMatches
allMatches.select{|m| m.finished == 1}
end
def finishedBracketMatches
finishedMatches.select{|m| m.bracket_position != "Pool"}
end
def finishedPoolMatches
finishedMatches.select{|m| m.bracket_position == "Pool"}
end
def poolWins
allMatches.select{|m| m.winner_id == self.id && m.bracket_position == "Pool"}
end
def seasonWinPercentage
@win = self.season_win.to_f
@loss = self.season_loss.to_f