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

@@ -4,21 +4,6 @@ class Weight < ActiveRecord::Base
attr_accessor :pools, :bracket_size, :bracket_type
def generatePool
@wrestlers = Wrestler.where(weight_id: self.id)
#@wrestlers.sort_by{|w| [w.original_seed]}
if self.pools == 1
@pool = Pool.new
@pool.onePool(@wrestlers,self.id,self.tournament_id)
elsif self.pools == 2
@pool = Pool.new
@pool.twoPools(@wrestlers,self.id,self.tournament_id)
elsif self.pools == 4
@pool = Pool.new
@pool.fourPools(@wrestlers,self.id,self.tournament_id)
end
end
def pools
@wrestlers = self.wrestlers
if @wrestlers.size <= 6