mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-22 22:37:01 +00:00
Generated bouts and rounds. Need to fix rounds for odd numbered pools.
This commit is contained in:
@@ -3,14 +3,15 @@ class Wrestler < ActiveRecord::Base
|
||||
belongs_to :weight
|
||||
attr_accessor :matches_all, :isWrestlingThisRound
|
||||
|
||||
def isWrestlingThisRound(round)
|
||||
@gMatches = Match.where(g_id: self.id, round: round)
|
||||
@rMatches = Match.where(r_id: self.id, round: round)
|
||||
def isWrestlingThisRound(matchRound)
|
||||
@gMatches = Match.where(g_id: self.id, round: matchRound)
|
||||
@rMatches = Match.where(r_id: self.id, round: matchRound)
|
||||
@allMatches = @gMatches + @rMatches
|
||||
if @allMatches == nil
|
||||
return true
|
||||
else
|
||||
if @gMatches.blank? and @rMatches.blank?
|
||||
return false
|
||||
else
|
||||
puts "He does wrestle this round"
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user