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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user