mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-24 17:04:43 +00:00
24 lines
525 B
Ruby
24 lines
525 B
Ruby
class Wrestler < ActiveRecord::Base
|
|
belongs_to :school
|
|
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)
|
|
@allMatches = @gMatches + @rMatches
|
|
if @allMatches == nil
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
def matches_all
|
|
@gMatches = Match.where(g_id: self.id)
|
|
@rMatches = Match.where(r_id: self.id)
|
|
return @gMatches + @rMatches
|
|
end
|
|
|
|
end
|