1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-11 08:11:38 +00:00

Create bracket views with upcomingMatches

This commit is contained in:
2015-03-16 08:35:56 -04:00
parent 7b9422fd6c
commit 2843760779
8 changed files with 34 additions and 71 deletions

View File

@@ -14,8 +14,9 @@ class Wrestler < ActiveRecord::Base
end
end
def boutByRound(round)
@match = matches_all.select{|m| m.round == round}.first
def boutByRound(round,matches)
@matches = matches.select{|m| m.w1 == self.id || m.w2 == self.id}
@match = @matches.select{|m| m.round == round}.first
if @match.blank?
return "BYE"
else