mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-11 07:56:28 +00:00
Added eight pools to quarter final bracket
This commit is contained in:
@@ -10,6 +10,8 @@ class GeneratePoolNumbers
|
||||
saveTwoPoolNumbers(@weight.wrestlers_without_pool_assignment)
|
||||
elsif @weight.pools == 1
|
||||
saveOnePoolNumbers(@weight.wrestlers_without_pool_assignment)
|
||||
elsif @weight.pools == 8
|
||||
saveEightPoolNumbers(@weight.wrestlers_without_pool_assignment)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -74,4 +76,35 @@ class GeneratePoolNumbers
|
||||
w.save
|
||||
end
|
||||
end
|
||||
|
||||
def saveEightPoolNumbers(poolWrestlers)
|
||||
pool = 1
|
||||
poolWrestlers.sort_by{|x| x.bracket_line }.reverse.each do |w|
|
||||
if w.bracket_line == 1
|
||||
w.pool = 1
|
||||
elsif w.bracket_line == 2
|
||||
w.pool = 2
|
||||
elsif w.bracket_line == 3
|
||||
w.pool = 3
|
||||
elsif w.bracket_line == 4
|
||||
w.pool = 4
|
||||
elsif w.bracket_line == 5
|
||||
w.pool = 5
|
||||
elsif w.bracket_line == 6
|
||||
w.pool = 6
|
||||
elsif w.bracket_line == 7
|
||||
w.pool = 7
|
||||
elsif w.bracket_line == 8
|
||||
w.pool = 8
|
||||
else
|
||||
w.pool = pool
|
||||
end
|
||||
if pool < 8
|
||||
pool = pool + 1
|
||||
else
|
||||
pool = 1
|
||||
end
|
||||
w.save
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user