1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-09 07:39:06 +00:00

Created 4 pool view without bracket.

This commit is contained in:
2015-02-03 15:06:02 -05:00
parent 0244d15a8b
commit 7183935b60
5 changed files with 110 additions and 107 deletions

View File

@@ -1,7 +1,7 @@
class Wrestler < ActiveRecord::Base
belongs_to :school
belongs_to :weight
attr_accessor :matches_all, :isWrestlingThisRound
attr_accessor :matches_all, :isWrestlingThisRound, :boutByRound
def isWrestlingThisRound(matchRound)
@gMatches = Match.where(g_id: self.id, round: matchRound)
@@ -10,11 +10,19 @@ class Wrestler < ActiveRecord::Base
if @gMatches.blank? and @rMatches.blank?
return false
else
puts "He does wrestle this round"
return true
end
end
def boutByRound(round)
@match = matches_all.select{|m| m.round == round}.first
if @match.blank?
return "BYE"
else
return @match.boutNumber
end
end
def matches_all
@gMatches = Match.where(g_id: self.id)
@rMatches = Match.where(r_id: self.id)