1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Added winner name for final line of brackets

This commit is contained in:
2015-10-15 15:13:52 -04:00
parent 386dc1605f
commit 4b447b86f9
5 changed files with 36 additions and 26 deletions

View File

@@ -44,7 +44,17 @@ class Match < ActiveRecord::Base
self.loser2_name
end
end
def winnerName
if self.finished != 1
return ""
end
if self.winner_id == self.w1
return self.w1_name
end
if self.winner_id == self.w2
return self.w2_name
end
end
def weight_max
Weight.find(self.weight_id).max
end