1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-12 08:25:19 +00:00

Added persistence to pool placement and pool order

This commit is contained in:
2019-04-19 10:33:06 -04:00
parent 31fbe5baff
commit a76f4036b3
15 changed files with 766 additions and 585 deletions

View File

@@ -5,10 +5,17 @@ class AdvanceWrestler
end
def advance
PoolAdvance.new(@wrestler,@wrestler.last_match).advanceWrestler if @tournament.tournament_type == "Pool to bracket"
pool_to_bracket_advancement if @tournament.tournament_type == "Pool to bracket"
end
if Rails.env.production?
handle_asynchronously :advance
end
def pool_to_bracket_advancement
if @wrestler.weight.all_pool_matches_finished(@wrestler.pool) and (@wrestler.finished_bracket_matches.size == 0 or @wrestler.weight.pools == 1)
PoolOrder.new(@wrestler.weight.wrestlers_in_pool(@wrestler.pool)).getPoolOrder
end
PoolAdvance.new(@wrestler,@wrestler.last_match).advanceWrestler
end
end