1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00
Files
wrestlingdev.com/app/models/match.rb
2015-06-19 15:25:01 +00:00

31 lines
451 B
Ruby

class Match < ActiveRecord::Base
belongs_to :tournament
belongs_to :weight
belongs_to :mat
WIN_TYPES = ["Decision", "Major", "Tech Fall", "Pin", "Forfeit", "Injury Default", "Default", "DQ"]
def w1_name
if self.w1
Wrestler.find(self.w1).name
else
self.loser1_name
end
end
def w2_name
if self.w2
Wrestler.find(self.w2).name
else
self.loser2_name
end
end
def weight_max
Weight.find(self.weight_id).max
end
end