mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-16 04:56:58 +00:00
sorting before generating
This commit is contained in:
@@ -9,7 +9,7 @@ class Pool
|
|||||||
|
|
||||||
|
|
||||||
def twoPools(wrestlers,weight_id,tournament)
|
def twoPools(wrestlers,weight_id,tournament)
|
||||||
wrestlers.sort_by{|x|[x.original_seed]}
|
#wrestlers.sort_by{|x|[x.original_seed]}
|
||||||
wrestlers.to_a
|
wrestlers.to_a
|
||||||
pool = 1
|
pool = 1
|
||||||
wrestlers.each do |w|
|
wrestlers.each do |w|
|
||||||
@@ -27,7 +27,7 @@ class Pool
|
|||||||
|
|
||||||
|
|
||||||
def fourPools(wrestlers,weight_id,tournament)
|
def fourPools(wrestlers,weight_id,tournament)
|
||||||
wrestlers.sort_by{|x|[x.original_seed]}
|
#wrestlers.sort_by{|x|[x.original_seed]}
|
||||||
wrestlers.to_a
|
wrestlers.to_a
|
||||||
pool = 1
|
pool = 1
|
||||||
wrestlers.each do |w|
|
wrestlers.each do |w|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ class Weight < ActiveRecord::Base
|
|||||||
|
|
||||||
def generatePool
|
def generatePool
|
||||||
@wrestlers = Wrestler.where(weight_id: self.id)
|
@wrestlers = Wrestler.where(weight_id: self.id)
|
||||||
|
@wrestlers.sort_by{|x|[x.original_seed]}
|
||||||
if self.pools == 1
|
if self.pools == 1
|
||||||
@pool = Pool.new
|
@pool = Pool.new
|
||||||
@pool.onePool(@wrestlers,self.id,self.tournament_id)
|
@pool.onePool(@wrestlers,self.id,self.tournament_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user