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:
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user