mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-28 18:04:55 +00:00
Refactored names of methods and some db column
This commit is contained in:
@@ -30,14 +30,14 @@ class PoolToBracketMatchGeneration
|
||||
def setOriginalSeedsToWrestleLastPoolRound(weight)
|
||||
pool = 1
|
||||
until pool > weight.pools
|
||||
wrestler1 = weight.poolSeedOrder(pool).first
|
||||
wrestler2 = weight.poolSeedOrder(pool).second
|
||||
match = wrestler1.poolMatches.sort_by{|m| m.round}.last
|
||||
wrestler1 = weight.pool_wrestlers_sorted_by_bracket_line(pool).first
|
||||
wrestler2 = weight.pool_wrestlers_sorted_by_bracket_line(pool).second
|
||||
match = wrestler1.pool_matches.sort_by{|m| m.round}.last
|
||||
if match.w1 != wrestler2.id or match.w2 != wrestler2.id
|
||||
if match.w1 == wrestler1.id
|
||||
SwapWrestlers.new.swapWrestlers(match.w2,wrestler2.id)
|
||||
SwapWrestlers.new.swap_wrestlers_bracket_lines(match.w2,wrestler2.id)
|
||||
elsif match.w2 == wrestler1.id
|
||||
SwapWrestlers.new.swapWrestlers(match.w1,wrestler2.id)
|
||||
SwapWrestlers.new.swap_wrestlers_bracket_lines(match.w1,wrestler2.id)
|
||||
end
|
||||
end
|
||||
pool += 1
|
||||
|
||||
Reference in New Issue
Block a user