1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-16 13:03:37 +00:00

Finished pool advance logic still need tests

This commit is contained in:
2015-10-14 17:58:28 -04:00
parent 087c383996
commit 386dc1605f
11 changed files with 120 additions and 70 deletions

View File

@@ -8,6 +8,19 @@ class Wrestler < ActiveRecord::Base
self.tournament.destroyAllMatches
end
def resultByBout(bout)
@match = Match.where("bout_number = ? AND finished = ?",bout,1)
if @match.size == 0
return ""
end
if @match.first.winner_id == self.id
return "W #{@match.first.score}"
end
if @match.first.winner_id != self.id
return "L #{@match.first.score}"
end
end
def isWrestlingThisRound(matchRound)
if allMatches.blank?