1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

sorting before generating

This commit is contained in:
2015-02-06 22:48:26 +00:00
parent e7113af9a2
commit 8c7c1abc99
2 changed files with 3 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ class Pool
def twoPools(wrestlers,weight_id,tournament)
wrestlers.sort_by{|x|[x.original_seed]}
#wrestlers.sort_by{|x|[x.original_seed]}
wrestlers.to_a
pool = 1
wrestlers.each do |w|
@@ -27,7 +27,7 @@ class Pool
def fourPools(wrestlers,weight_id,tournament)
wrestlers.sort_by{|x|[x.original_seed]}
#wrestlers.sort_by{|x|[x.original_seed]}
wrestlers.to_a
pool = 1
wrestlers.each do |w|

View File

@@ -6,6 +6,7 @@ class Weight < ActiveRecord::Base
def generatePool
@wrestlers = Wrestler.where(weight_id: self.id)
@wrestlers.sort_by{|x|[x.original_seed]}
if self.pools == 1
@pool = Pool.new
@pool.onePool(@wrestlers,self.id,self.tournament_id)