mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
sorting before generating
This commit is contained in:
@@ -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|
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user