1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-13 00:26:31 +00:00

Calculate matchups for pools. This breaks generating matches.

This commit is contained in:
2015-03-12 15:03:38 -04:00
parent d68cebc6e4
commit dc9639cf1c
5 changed files with 73 additions and 21 deletions

View File

@@ -10,9 +10,14 @@ class Tournament < ActiveRecord::Base
end
def upcomingMatches
@matches = Match.where(tournament_id: self.id)
@matches.sort_by{|x|[x.boutNumber]}
# @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)
end
return @upcomingMatches
end