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:
@@ -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
|
||||
Reference in New Issue
Block a user