1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-12 00:20:58 +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

@@ -10,9 +10,6 @@ class Tournament < ActiveRecord::Base
end
def upcomingMatches
# @matches = Match.where(tournament_id: self.id)
# @matches.sort_by{|x|[x.boutNumber]}
# @matches.sort_by{|x|[x.round,x.weight.max]}
@matches = []
self.weights.sort_by{|x|[x.max]}.each do |weight|
@upcomingMatches = weight.generateMatchups(@matches)
@@ -22,16 +19,6 @@ class Tournament < ActiveRecord::Base
end
def generateMatches
destroyAllMatches
self.weights.each do |weight|
weight.generatePool
end
# assignRound
assignBouts
end
handle_asynchronously :generateMatches
def destroyAllMatches
@matches_all = Match.where(tournament_id: self.id)
@matches_all.each do |match|