From a763c966d158d336b7bae5c50540c397762b0b1c Mon Sep 17 00:00:00 2001 From: jcwimer Date: Sat, 7 May 2016 02:06:11 +0000 Subject: [PATCH 1/3] Sped up tests and updated Pool Order --- app/models/pool_order.rb | 33 +- test/fixtures/matches.yml | 3282 ++++++++++----------- test/fixtures/wrestlers.yml | 214 +- test/integration/pool_advancement_test.rb | 2 +- test/integration/single_test_test.rb | 4 +- 5 files changed, 1809 insertions(+), 1726 deletions(-) diff --git a/app/models/pool_order.rb b/app/models/pool_order.rb index f88b934..a03eebe 100644 --- a/app/models/pool_order.rb +++ b/app/models/pool_order.rb @@ -109,21 +109,26 @@ class PoolOrder end def fastestPin - timeArray = [] - wrestlersWithSamePoints.each do |w| - timeArray << w.fastestPin + wrestlersWithSamePointsWithPins = [] + wrestlersWithSamePoints.each do |wr| + if wr.pinWins.size > 0 + wrestlersWithSamePointsWithPins << wr + end end - fastest = timeArray.max - wrestlersWithFastestPin = wrestlersWithSamePoints.select{|w| w.fastestPin == fastest} - addPointsToWrestlersAhead(wrestlersWithFastestPin.first) - wrestlersWithFastestPin.each do |wr| - addPoints(wr) - end - secondFastest = timeArray.sort[-2] - wrestlersWithSecondFastestPin = wrestlersWithSamePoints.select{|w| w.fastestPin == secondFastest} - addPointsToWrestlersAhead(wrestlersWithSecondFastestPin.first) - wrestlersWithSecondFastestPin.each do |wr| - addPoints(wr) + if wrestlersWithSamePointsWithPins.size > 0 + fastest = wrestlersWithSamePointsWithPins.sort_by{|w| w.fastestPin.pinTime}.first.fastestPin + secondFastest = wrestlersWithSamePointsWithPins.sort_by{|w| w.fastestPin.pinTime}.second.fastestPin + wrestlersWithFastestPin = wrestlersWithSamePointsWithPins.select{|w| w.fastestPin.pinTime == fastest.pinTime} + addPointsToWrestlersAhead(wrestlersWithFastestPin.first) + wrestlersWithFastestPin.each do |wr| + addPoints(wr) + end + + wrestlersWithSecondFastestPin = wrestlersWithSamePointsWithPins.select{|w| w.fastestPin.pinTime == secondFastest.pinTime} + addPointsToWrestlersAhead(wrestlersWithSecondFastestPin.first) + wrestlersWithSecondFastestPin.each do |wr| + addPoints(wr) + end end end diff --git a/test/fixtures/matches.yml b/test/fixtures/matches.yml index 09e08a5..7e31d38 100644 --- a/test/fixtures/matches.yml +++ b/test/fixtures/matches.yml @@ -1,115 +1,9 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -# http://chriskottom.com/blog/2014/11/fixing-fixtures/ - # t.integer "w1" - # t.integer "w2" - # t.text "w1_stat" - # t.text "w2_stat" - # t.integer "winner_id" - # t.string "win_type" - # t.string "score" - # t.datetime "created_at" - # t.datetime "updated_at" - # t.integer "tournament_id" - # t.integer "round" - # t.integer "finished" - # t.integer "bout_number" - # t.integer "weight_id" - # t.string "bracket_position" - # t.integer "bracket_position_number" - # t.string "loser1_name" - # t.string "loser2_name" - # t.integer "mat_id" - - -# default: &default -# tournament_id: 1 - - -# one: -# <<: *defaults - -tournament_1_bout_3007: - tournament_id: 1 - weight_id: 2 - bout_number: 3007 - w1: 10 - w2: 7 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_6000: - tournament_id: 1 - weight_id: 3 - bout_number: 6000 - w1: - w2: - bracket_position: 1/2 - bracket_position_number: 1 - loser1_name: Winner Pool 1 - loser2_name: Winner Pool 2 - round: 6 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3013: - tournament_id: 1 - weight_id: 5 - bout_number: 3013 - w1: 39 - w2: 35 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_4001: +tournament_1_bout_1000: tournament_id: 1 weight_id: 1 - bout_number: 4001 - w1: 1 - w2: 5 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1002: - tournament_id: 1 - weight_id: 3 - bout_number: 1002 - w1: 18 - w2: 19 + bout_number: 1000 + w1: 2 + w2: 1 bracket_position: Pool bracket_position_number: loser1_name: @@ -123,18 +17,18 @@ tournament_1_bout_1002: winner_id: win_type: -tournament_1_bout_3002: +tournament_1_bout_1001: tournament_id: 1 - weight_id: 3 - bout_number: 3002 - w1: 19 - w2: 21 + weight_id: 1 + bout_number: 1001 + w1: 3 + w2: 4 bracket_position: Pool bracket_position_number: loser1_name: loser2_name: - round: 3 - mat_id: + round: 1 + mat_id: 1 finished: w1_stat: w2_stat: @@ -142,12 +36,12 @@ tournament_1_bout_3002: winner_id: win_type: -tournament_1_bout_2021: +tournament_1_bout_2000: tournament_id: 1 - weight_id: 6 - bout_number: 2021 - w1: 50 - w2: 51 + weight_id: 1 + bout_number: 2000 + w1: 5 + w2: 4 bracket_position: Pool bracket_position_number: loser1_name: @@ -161,177 +55,6 @@ tournament_1_bout_2021: winner_id: win_type: -tournament_1_bout_1007: - tournament_id: 1 - weight_id: 2 - bout_number: 1007 - w1: 11 - w2: 10 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2004: - tournament_id: 1 - weight_id: 3 - bout_number: 2004 - w1: 16 - w2: 14 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1011: - tournament_id: 1 - weight_id: 4 - bout_number: 1011 - w1: 25 - w2: 32 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_4004: - tournament_id: 1 - weight_id: 2 - bout_number: 4004 - w1: - w2: - bracket_position: Semis - bracket_position_number: 1 - loser1_name: Winner Pool 1 - loser2_name: Runner Up Pool 2 - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_4014: - tournament_id: 1 - weight_id: 6 - bout_number: 4014 - w1: 49 - w2: 50 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_6002: - tournament_id: 1 - weight_id: 2 - bout_number: 6002 - w1: - w2: - bracket_position: 1/2 - bracket_position_number: 1 - loser1_name: - loser2_name: - round: 6 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_4007: - tournament_id: 1 - weight_id: 4 - bout_number: 4007 - w1: - w2: - bracket_position: Quarter - bracket_position_number: 2 - loser1_name: Winner Pool 4 - loser2_name: Runner Up Pool 3 - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_4013: - tournament_id: 1 - weight_id: 5 - bout_number: 4013 - w1: - w2: - bracket_position: Conso Semis - bracket_position_number: 2 - loser1_name: Runner Up Pool 2 - loser2_name: Runner Up Pool 3 - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1019: - tournament_id: 1 - weight_id: 5 - bout_number: 1019 - w1: 38 - w2: 48 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - tournament_1_bout_2001: tournament_id: 1 weight_id: 1 @@ -351,848 +74,12 @@ tournament_1_bout_2001: winner_id: win_type: -tournament_1_bout_1017: - tournament_id: 1 - weight_id: 5 - bout_number: 1017 - w1: 34 - w2: 47 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1014: - tournament_id: 1 - weight_id: 5 - bout_number: 1014 - w1: 45 - w2: 39 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_6011: - tournament_id: 1 - weight_id: 5 - bout_number: 6011 - w1: - w2: - bracket_position: 7/8 - bracket_position_number: 1 - loser1_name: Loser of 4012 - loser2_name: Loser of 4013 - round: 6 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3018: - tournament_id: 1 - weight_id: 5 - bout_number: 3018 - w1: 40 - w2: 48 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2014: - tournament_id: 1 - weight_id: 5 - bout_number: 2014 - w1: 37 - w2: 33 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_6005: - tournament_id: 1 - weight_id: 4 - bout_number: 6005 - w1: - w2: - bracket_position: 3/4 - bracket_position_number: 1 - loser1_name: Loser of 5004 - loser2_name: Loser of 5005 - round: 6 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_5002: - tournament_id: 1 - weight_id: 3 - bout_number: 5002 - w1: 21 - w2: 13 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 5 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3009: - tournament_id: 1 - weight_id: 4 - bout_number: 3009 - w1: 27 - w2: 30 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_5005: - tournament_id: 1 - weight_id: 4 - bout_number: 5005 - w1: - w2: - bracket_position: Semis - bracket_position_number: 2 - loser1_name: - loser2_name: - round: 5 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3021: - tournament_id: 1 - weight_id: 6 - bout_number: 3021 - w1: 52 - w2: 50 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2009: - tournament_id: 1 - weight_id: 4 - bout_number: 2009 - w1: 30 - w2: 28 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3011: - tournament_id: 1 - weight_id: 4 - bout_number: 3011 - w1: 32 - w2: 24 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_6001: - tournament_id: 1 - weight_id: 3 - bout_number: 6001 - w1: - w2: - bracket_position: 3/4 - bracket_position_number: 1 - loser1_name: Runner Up Pool 1 - loser2_name: Runner Up Pool 2 - round: 6 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_6008: - tournament_id: 1 - weight_id: 5 - bout_number: 6008 - w1: - w2: - bracket_position: 1/2 - bracket_position_number: 1 - loser1_name: - loser2_name: - round: 6 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3017: - tournament_id: 1 - weight_id: 5 - bout_number: 3017 - w1: 41 - w2: 34 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_4000: +tournament_1_bout_3000: tournament_id: 1 weight_id: 1 - bout_number: 4000 - w1: 4 - w2: 2 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3015: - tournament_id: 1 - weight_id: 5 - bout_number: 3015 - w1: 37 - w2: 44 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2012: - tournament_id: 1 - weight_id: 5 - bout_number: 2012 - w1: 39 - w2: 46 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2000: - tournament_id: 1 - weight_id: 1 - bout_number: 2000 - w1: 5 - w2: 4 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1021: - tournament_id: 1 - weight_id: 6 - bout_number: 1021 - w1: 50 - w2: 53 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2019: - tournament_id: 1 - weight_id: 5 - bout_number: 2019 - w1: 38 - w2: 40 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1016: - tournament_id: 1 - weight_id: 5 - bout_number: 1016 - w1: 36 - w2: 37 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_6006: - tournament_id: 1 - weight_id: 4 - bout_number: 6006 - w1: - w2: - bracket_position: 5/6 - bracket_position_number: 1 - loser1_name: - loser2_name: - round: 6 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_5009: - tournament_id: 1 - weight_id: 6 - bout_number: 5009 - w1: 49 - w2: 53 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 5 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3010: - tournament_id: 1 - weight_id: 4 - bout_number: 3010 - w1: 22 - w2: 31 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_4008: - tournament_id: 1 - weight_id: 4 - bout_number: 4008 - w1: - w2: - bracket_position: Quarter - bracket_position_number: 3 - loser1_name: Winner Pool 2 - loser2_name: Runner Up Pool 1 - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3008: - tournament_id: 1 - weight_id: 2 - bout_number: 3008 - w1: 6 - w2: 9 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2005: - tournament_id: 1 - weight_id: 3 - bout_number: 2005 - w1: 17 - w2: 15 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1003: - tournament_id: 1 - weight_id: 3 - bout_number: 1003 - w1: 21 - w2: 20 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: 1 - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2017: - tournament_id: 1 - weight_id: 5 - bout_number: 2017 - w1: 34 - w2: 43 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_4011: - tournament_id: 1 - weight_id: 5 - bout_number: 4011 - w1: - w2: - bracket_position: Semis - bracket_position_number: 2 - loser1_name: Winner Pool 2 - loser2_name: Winner Pool 3 - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3003: - tournament_id: 1 - weight_id: 3 - bout_number: 3003 - w1: 13 - w2: 18 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_5006: - tournament_id: 1 - weight_id: 4 - bout_number: 5006 - w1: - w2: - bracket_position: Conso Semis - bracket_position_number: 1 - loser1_name: Loser of 4006 - loser2_name: Loser of 4007 - round: 5 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3006: - tournament_id: 1 - weight_id: 2 - bout_number: 3006 - w1: 11 - w2: 12 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_5003: - tournament_id: 1 - weight_id: 3 - bout_number: 5003 - w1: 20 - w2: 19 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 5 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_5008: - tournament_id: 1 - weight_id: 6 - bout_number: 5008 - w1: 51 - w2: 52 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 5 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2010: - tournament_id: 1 - weight_id: 4 - bout_number: 2010 - w1: 31 - w2: 23 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_4009: - tournament_id: 1 - weight_id: 4 - bout_number: 4009 - w1: - w2: - bracket_position: Quarter - bracket_position_number: 4 - loser1_name: Winner Pool 3 - loser2_name: Runner Up Pool 4 - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1001: - tournament_id: 1 - weight_id: 1 - bout_number: 1001 - w1: 3 - w2: 4 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: 1 - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1022: - tournament_id: 1 - weight_id: 6 - bout_number: 1022 - w1: 51 - w2: 49 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2018: - tournament_id: 1 - weight_id: 5 - bout_number: 2018 - w1: 42 - w2: 48 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1015: - tournament_id: 1 - weight_id: 5 - bout_number: 1015 - w1: 44 - w2: 33 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_6007: - tournament_id: 1 - weight_id: 4 - bout_number: 6007 - w1: - w2: - bracket_position: 7/8 - bracket_position_number: 1 - loser1_name: Loser of 5006 - loser2_name: Loser of 5007 - round: 6 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_6009: - tournament_id: 1 - weight_id: 5 - bout_number: 6009 - w1: - w2: - bracket_position: 3/4 - bracket_position_number: 1 - loser1_name: Loser of 4010 - loser2_name: Loser of 4011 - round: 6 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3016: - tournament_id: 1 - weight_id: 5 - bout_number: 3016 - w1: 43 - w2: 47 + bout_number: 3000 + w1: 1 + w2: 3 bracket_position: Pool bracket_position_number: loser1_name: @@ -1225,17 +112,17 @@ tournament_1_bout_3001: winner_id: win_type: -tournament_1_bout_3014: +tournament_1_bout_4000: tournament_id: 1 - weight_id: 5 - bout_number: 3014 - w1: 36 - w2: 33 + weight_id: 1 + bout_number: 4000 + w1: 4 + w2: 2 bracket_position: Pool bracket_position_number: loser1_name: loser2_name: - round: 3 + round: 4 mat_id: finished: w1_stat: @@ -1244,17 +131,17 @@ tournament_1_bout_3014: winner_id: win_type: -tournament_1_bout_2013: +tournament_1_bout_4001: tournament_id: 1 - weight_id: 5 - bout_number: 2013 - w1: 35 - w2: 45 + weight_id: 1 + bout_number: 4001 + w1: 1 + w2: 5 bracket_position: Pool bracket_position_number: loser1_name: loser2_name: - round: 2 + round: 4 mat_id: finished: w1_stat: @@ -1263,130 +150,16 @@ tournament_1_bout_2013: winner_id: win_type: -tournament_1_bout_1006: +tournament_1_bout_5000: tournament_id: 1 - weight_id: 2 - bout_number: 1006 - w1: 7 - w2: 12 + weight_id: 1 + bout_number: 5000 + w1: 3 + w2: 5 bracket_position: Pool bracket_position_number: loser1_name: loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3020: - tournament_id: 1 - weight_id: 6 - bout_number: 3020 - w1: 53 - w2: 51 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1009: - tournament_id: 1 - weight_id: 4 - bout_number: 1009 - w1: 28 - w2: 27 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1012: - tournament_id: 1 - weight_id: 4 - bout_number: 1012 - w1: 26 - w2: 29 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2007: - tournament_id: 1 - weight_id: 2 - bout_number: 2007 - w1: 7 - w2: 11 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1004: - tournament_id: 1 - weight_id: 3 - bout_number: 1004 - w1: 17 - w2: 14 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_5007: - tournament_id: 1 - weight_id: 4 - bout_number: 5007 - w1: - w2: - bracket_position: Conso Semis - bracket_position_number: 2 - loser1_name: Loser of 4008 - loser2_name: Loser of 4009 round: 5 mat_id: finished: @@ -1396,18 +169,37 @@ tournament_1_bout_5007: winner_id: win_type: -tournament_1_bout_4002: +tournament_1_bout_5001: + tournament_id: 1 + weight_id: 1 + bout_number: 5001 + w1: 4 + w2: 1 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 5 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1002: tournament_id: 1 weight_id: 3 - bout_number: 4002 - w1: 20 - w2: 18 + bout_number: 1002 + w1: 18 + w2: 19 bracket_position: Pool bracket_position_number: loser1_name: loser2_name: - round: 4 - mat_id: + round: 1 + mat_id: 1 finished: w1_stat: w2_stat: @@ -1415,37 +207,18 @@ tournament_1_bout_4002: winner_id: win_type: -tournament_1_bout_4010: +tournament_1_bout_1003: tournament_id: 1 - weight_id: 5 - bout_number: 4010 - w1: - w2: - bracket_position: Semis - bracket_position_number: 1 - loser1_name: Winner Pool 1 - loser2_name: Winner Pool 4 - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2016: - tournament_id: 1 - weight_id: 5 - bout_number: 2016 - w1: 41 - w2: 47 + weight_id: 3 + bout_number: 1003 + w1: 21 + w2: 20 bracket_position: Pool bracket_position_number: loser1_name: loser2_name: - round: 2 - mat_id: + round: 1 + mat_id: 1 finished: w1_stat: w2_stat: @@ -1472,120 +245,6 @@ tournament_1_bout_2002: winner_id: win_type: -tournament_1_bout_2008: - tournament_id: 1 - weight_id: 2 - bout_number: 2008 - w1: 9 - w2: 8 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3004: - tournament_id: 1 - weight_id: 3 - bout_number: 3004 - w1: 15 - w2: 14 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2011: - tournament_id: 1 - weight_id: 4 - bout_number: 2011 - w1: 24 - w2: 25 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2006: - tournament_id: 1 - weight_id: 2 - bout_number: 2006 - w1: 10 - w2: 12 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1005: - tournament_id: 1 - weight_id: 3 - bout_number: 1005 - w1: 15 - w2: 16 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2020: - tournament_id: 1 - weight_id: 6 - bout_number: 2020 - w1: 52 - w2: 49 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 2 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - tournament_1_bout_2003: tournament_id: 1 weight_id: 3 @@ -1605,31 +264,12 @@ tournament_1_bout_2003: winner_id: win_type: -tournament_1_bout_5001: +tournament_1_bout_3002: tournament_id: 1 - weight_id: 1 - bout_number: 5001 - w1: 4 - w2: 1 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 5 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3012: - tournament_id: 1 - weight_id: 5 - bout_number: 3012 - w1: 45 - w2: 46 + weight_id: 3 + bout_number: 3002 + w1: 19 + w2: 21 bracket_position: Pool bracket_position_number: loser1_name: @@ -1643,12 +283,69 @@ tournament_1_bout_3012: winner_id: win_type: -tournament_1_bout_5000: +tournament_1_bout_3003: tournament_id: 1 - weight_id: 1 - bout_number: 5000 - w1: 3 - w2: 5 + weight_id: 3 + bout_number: 3003 + w1: 13 + w2: 18 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_4002: + tournament_id: 1 + weight_id: 3 + bout_number: 4002 + w1: 20 + w2: 18 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 4 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_4003: + tournament_id: 1 + weight_id: 3 + bout_number: 4003 + w1: 19 + w2: 13 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 4 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_5002: + tournament_id: 1 + weight_id: 3 + bout_number: 5002 + w1: 21 + w2: 13 bracket_position: Pool bracket_position_number: loser1_name: @@ -1662,6 +359,291 @@ tournament_1_bout_5000: winner_id: win_type: +tournament_1_bout_5003: + tournament_id: 1 + weight_id: 3 + bout_number: 5003 + w1: 20 + w2: 19 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 5 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1004: + tournament_id: 1 + weight_id: 3 + bout_number: 1004 + w1: 17 + w2: 14 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1005: + tournament_id: 1 + weight_id: 3 + bout_number: 1005 + w1: 15 + w2: 16 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2004: + tournament_id: 1 + weight_id: 3 + bout_number: 2004 + w1: 16 + w2: 14 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2005: + tournament_id: 1 + weight_id: 3 + bout_number: 2005 + w1: 17 + w2: 15 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3004: + tournament_id: 1 + weight_id: 3 + bout_number: 3004 + w1: 15 + w2: 14 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3005: + tournament_id: 1 + weight_id: 3 + bout_number: 3005 + w1: 16 + w2: 17 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_6000: + tournament_id: 1 + weight_id: 3 + bout_number: 6000 + w1: + w2: + bracket_position: 1/2 + bracket_position_number: 1 + loser1_name: Winner Pool 1 + loser2_name: Winner Pool 2 + round: 6 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_6001: + tournament_id: 1 + weight_id: 3 + bout_number: 6001 + w1: + w2: + bracket_position: 3/4 + bracket_position_number: 1 + loser1_name: Runner Up Pool 1 + loser2_name: Runner Up Pool 2 + round: 6 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1006: + tournament_id: 1 + weight_id: 2 + bout_number: 1006 + w1: 7 + w2: 12 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1007: + tournament_id: 1 + weight_id: 2 + bout_number: 1007 + w1: 11 + w2: 10 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2006: + tournament_id: 1 + weight_id: 2 + bout_number: 2006 + w1: 10 + w2: 12 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2007: + tournament_id: 1 + weight_id: 2 + bout_number: 2007 + w1: 7 + w2: 11 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3006: + tournament_id: 1 + weight_id: 2 + bout_number: 3006 + w1: 11 + w2: 12 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3007: + tournament_id: 1 + weight_id: 2 + bout_number: 3007 + w1: 10 + w2: 7 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + tournament_1_bout_1008: tournament_id: 1 weight_id: 2 @@ -1681,12 +663,164 @@ tournament_1_bout_1008: winner_id: win_type: -tournament_1_bout_3005: +tournament_1_bout_2008: tournament_id: 1 - weight_id: 3 - bout_number: 3005 - w1: 16 - w2: 17 + weight_id: 2 + bout_number: 2008 + w1: 9 + w2: 8 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3008: + tournament_id: 1 + weight_id: 2 + bout_number: 3008 + w1: 6 + w2: 9 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_4004: + tournament_id: 1 + weight_id: 2 + bout_number: 4004 + w1: + w2: + bracket_position: Semis + bracket_position_number: 1 + loser1_name: Winner Pool 1 + loser2_name: Runner Up Pool 2 + round: 4 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_4005: + tournament_id: 1 + weight_id: 2 + bout_number: 4005 + w1: + w2: + bracket_position: Semis + bracket_position_number: 2 + loser1_name: Winner Pool 2 + loser2_name: Runner Up Pool 1 + round: 4 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_6002: + tournament_id: 1 + weight_id: 2 + bout_number: 6002 + w1: + w2: + bracket_position: 1/2 + bracket_position_number: 1 + loser1_name: + loser2_name: + round: 6 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_6003: + tournament_id: 1 + weight_id: 2 + bout_number: 6003 + w1: + w2: + bracket_position: 3/4 + bracket_position_number: 1 + loser1_name: Loser of 4004 + loser2_name: Loser of 4005 + round: 6 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1009: + tournament_id: 1 + weight_id: 4 + bout_number: 1009 + w1: 28 + w2: 27 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2009: + tournament_id: 1 + weight_id: 4 + bout_number: 2009 + w1: 30 + w2: 28 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3009: + tournament_id: 1 + weight_id: 4 + bout_number: 3009 + w1: 27 + w2: 30 bracket_position: Pool bracket_position_number: loser1_name: @@ -1719,107 +853,12 @@ tournament_1_bout_1010: winner_id: win_type: -tournament_1_bout_5004: +tournament_1_bout_2010: tournament_id: 1 weight_id: 4 - bout_number: 5004 - w1: - w2: - bracket_position: Semis - bracket_position_number: 1 - loser1_name: - loser2_name: - round: 5 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_4003: - tournament_id: 1 - weight_id: 3 - bout_number: 4003 - w1: 19 - w2: 13 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1000: - tournament_id: 1 - weight_id: 1 - bout_number: 1000 - w1: 2 - w2: 1 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: 1 - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_6010: - tournament_id: 1 - weight_id: 5 - bout_number: 6010 - w1: - w2: - bracket_position: 5/6 - bracket_position_number: 1 - loser1_name: - loser2_name: - round: 6 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3019: - tournament_id: 1 - weight_id: 5 - bout_number: 3019 - w1: 42 - w2: 38 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 3 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_2015: - tournament_id: 1 - weight_id: 5 - bout_number: 2015 - w1: 44 - w2: 36 + bout_number: 2010 + w1: 31 + w2: 23 bracket_position: Pool bracket_position_number: loser1_name: @@ -1833,69 +872,12 @@ tournament_1_bout_2015: winner_id: win_type: -tournament_1_bout_6004: +tournament_1_bout_3010: tournament_id: 1 weight_id: 4 - bout_number: 6004 - w1: - w2: - bracket_position: 1/2 - bracket_position_number: 1 - loser1_name: - loser2_name: - round: 6 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_4012: - tournament_id: 1 - weight_id: 5 - bout_number: 4012 - w1: - w2: - bracket_position: Conso Semis - bracket_position_number: 1 - loser1_name: Runner Up Pool 1 - loser2_name: Runner Up Pool 4 - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_1020: - tournament_id: 1 - weight_id: 5 - bout_number: 1020 - w1: 40 - w2: 42 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 1 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_3000: - tournament_id: 1 - weight_id: 1 - bout_number: 3000 - w1: 1 - w2: 3 + bout_number: 3010 + w1: 22 + w2: 31 bracket_position: Pool bracket_position_number: loser1_name: @@ -1909,12 +891,12 @@ tournament_1_bout_3000: winner_id: win_type: -tournament_1_bout_1018: +tournament_1_bout_1011: tournament_id: 1 - weight_id: 5 - bout_number: 1018 - w1: 43 - w2: 41 + weight_id: 4 + bout_number: 1011 + w1: 25 + w2: 32 bracket_position: Pool bracket_position_number: loser1_name: @@ -1928,12 +910,50 @@ tournament_1_bout_1018: winner_id: win_type: -tournament_1_bout_1013: +tournament_1_bout_2011: tournament_id: 1 - weight_id: 5 - bout_number: 1013 - w1: 35 - w2: 46 + weight_id: 4 + bout_number: 2011 + w1: 24 + w2: 25 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3011: + tournament_id: 1 + weight_id: 4 + bout_number: 3011 + w1: 32 + w2: 24 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1012: + tournament_id: 1 + weight_id: 4 + bout_number: 1012 + w1: 26 + w2: 29 bracket_position: Pool bracket_position_number: loser1_name: @@ -1947,44 +967,6 @@ tournament_1_bout_1013: winner_id: win_type: -tournament_1_bout_4015: - tournament_id: 1 - weight_id: 6 - bout_number: 4015 - w1: 53 - w2: 52 - bracket_position: Pool - bracket_position_number: - loser1_name: - loser2_name: - round: 4 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - -tournament_1_bout_6003: - tournament_id: 1 - weight_id: 2 - bout_number: 6003 - w1: - w2: - bracket_position: 3/4 - bracket_position_number: 1 - loser1_name: Loser of 4004 - loser2_name: Loser of 4005 - round: 6 - mat_id: - finished: - w1_stat: - w2_stat: - score: - winner_id: - win_type: - tournament_1_bout_4006: tournament_id: 1 weight_id: 4 @@ -2004,14 +986,33 @@ tournament_1_bout_4006: winner_id: win_type: -tournament_1_bout_4005: +tournament_1_bout_4007: tournament_id: 1 - weight_id: 2 - bout_number: 4005 + weight_id: 4 + bout_number: 4007 w1: w2: - bracket_position: Semis + bracket_position: Quarter bracket_position_number: 2 + loser1_name: Winner Pool 4 + loser2_name: Runner Up Pool 3 + round: 4 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_4008: + tournament_id: 1 + weight_id: 4 + bout_number: 4008 + w1: + w2: + bracket_position: Quarter + bracket_position_number: 3 loser1_name: Winner Pool 2 loser2_name: Runner Up Pool 1 round: 4 @@ -2022,3 +1023,972 @@ tournament_1_bout_4005: score: winner_id: win_type: + +tournament_1_bout_4009: + tournament_id: 1 + weight_id: 4 + bout_number: 4009 + w1: + w2: + bracket_position: Quarter + bracket_position_number: 4 + loser1_name: Winner Pool 3 + loser2_name: Runner Up Pool 4 + round: 4 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_5004: + tournament_id: 1 + weight_id: 4 + bout_number: 5004 + w1: + w2: + bracket_position: Semis + bracket_position_number: 1 + loser1_name: + loser2_name: + round: 5 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_5005: + tournament_id: 1 + weight_id: 4 + bout_number: 5005 + w1: + w2: + bracket_position: Semis + bracket_position_number: 2 + loser1_name: + loser2_name: + round: 5 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_5006: + tournament_id: 1 + weight_id: 4 + bout_number: 5006 + w1: + w2: + bracket_position: Conso Semis + bracket_position_number: 1 + loser1_name: Loser of 4006 + loser2_name: Loser of 4007 + round: 5 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_5007: + tournament_id: 1 + weight_id: 4 + bout_number: 5007 + w1: + w2: + bracket_position: Conso Semis + bracket_position_number: 2 + loser1_name: Loser of 4008 + loser2_name: Loser of 4009 + round: 5 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_6004: + tournament_id: 1 + weight_id: 4 + bout_number: 6004 + w1: + w2: + bracket_position: 1/2 + bracket_position_number: 1 + loser1_name: + loser2_name: + round: 6 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_6005: + tournament_id: 1 + weight_id: 4 + bout_number: 6005 + w1: + w2: + bracket_position: 3/4 + bracket_position_number: 1 + loser1_name: Loser of 5004 + loser2_name: Loser of 5005 + round: 6 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_6006: + tournament_id: 1 + weight_id: 4 + bout_number: 6006 + w1: + w2: + bracket_position: 5/6 + bracket_position_number: 1 + loser1_name: + loser2_name: + round: 6 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_6007: + tournament_id: 1 + weight_id: 4 + bout_number: 6007 + w1: + w2: + bracket_position: 7/8 + bracket_position_number: 1 + loser1_name: Loser of 5006 + loser2_name: Loser of 5007 + round: 6 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1013: + tournament_id: 1 + weight_id: 5 + bout_number: 1013 + w1: 35 + w2: 46 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1014: + tournament_id: 1 + weight_id: 5 + bout_number: 1014 + w1: 45 + w2: 39 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2012: + tournament_id: 1 + weight_id: 5 + bout_number: 2012 + w1: 39 + w2: 46 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2013: + tournament_id: 1 + weight_id: 5 + bout_number: 2013 + w1: 35 + w2: 45 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3012: + tournament_id: 1 + weight_id: 5 + bout_number: 3012 + w1: 45 + w2: 46 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3013: + tournament_id: 1 + weight_id: 5 + bout_number: 3013 + w1: 39 + w2: 35 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1015: + tournament_id: 1 + weight_id: 5 + bout_number: 1015 + w1: 44 + w2: 33 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1016: + tournament_id: 1 + weight_id: 5 + bout_number: 1016 + w1: 36 + w2: 37 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2014: + tournament_id: 1 + weight_id: 5 + bout_number: 2014 + w1: 37 + w2: 33 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2015: + tournament_id: 1 + weight_id: 5 + bout_number: 2015 + w1: 44 + w2: 36 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3014: + tournament_id: 1 + weight_id: 5 + bout_number: 3014 + w1: 36 + w2: 33 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3015: + tournament_id: 1 + weight_id: 5 + bout_number: 3015 + w1: 37 + w2: 44 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1017: + tournament_id: 1 + weight_id: 5 + bout_number: 1017 + w1: 34 + w2: 47 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1018: + tournament_id: 1 + weight_id: 5 + bout_number: 1018 + w1: 43 + w2: 41 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2016: + tournament_id: 1 + weight_id: 5 + bout_number: 2016 + w1: 41 + w2: 47 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2017: + tournament_id: 1 + weight_id: 5 + bout_number: 2017 + w1: 34 + w2: 43 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3016: + tournament_id: 1 + weight_id: 5 + bout_number: 3016 + w1: 43 + w2: 47 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3017: + tournament_id: 1 + weight_id: 5 + bout_number: 3017 + w1: 41 + w2: 34 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1019: + tournament_id: 1 + weight_id: 5 + bout_number: 1019 + w1: 38 + w2: 48 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1020: + tournament_id: 1 + weight_id: 5 + bout_number: 1020 + w1: 40 + w2: 42 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2018: + tournament_id: 1 + weight_id: 5 + bout_number: 2018 + w1: 42 + w2: 48 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2019: + tournament_id: 1 + weight_id: 5 + bout_number: 2019 + w1: 38 + w2: 40 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3018: + tournament_id: 1 + weight_id: 5 + bout_number: 3018 + w1: 40 + w2: 48 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3019: + tournament_id: 1 + weight_id: 5 + bout_number: 3019 + w1: 42 + w2: 38 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_4010: + tournament_id: 1 + weight_id: 5 + bout_number: 4010 + w1: + w2: + bracket_position: Semis + bracket_position_number: 1 + loser1_name: Winner Pool 1 + loser2_name: Winner Pool 4 + round: 4 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_4011: + tournament_id: 1 + weight_id: 5 + bout_number: 4011 + w1: + w2: + bracket_position: Semis + bracket_position_number: 2 + loser1_name: Winner Pool 2 + loser2_name: Winner Pool 3 + round: 4 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_4012: + tournament_id: 1 + weight_id: 5 + bout_number: 4012 + w1: + w2: + bracket_position: Conso Semis + bracket_position_number: 1 + loser1_name: Runner Up Pool 1 + loser2_name: Runner Up Pool 4 + round: 4 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_4013: + tournament_id: 1 + weight_id: 5 + bout_number: 4013 + w1: + w2: + bracket_position: Conso Semis + bracket_position_number: 2 + loser1_name: Runner Up Pool 2 + loser2_name: Runner Up Pool 3 + round: 4 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_6008: + tournament_id: 1 + weight_id: 5 + bout_number: 6008 + w1: + w2: + bracket_position: 1/2 + bracket_position_number: 1 + loser1_name: + loser2_name: + round: 6 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_6009: + tournament_id: 1 + weight_id: 5 + bout_number: 6009 + w1: + w2: + bracket_position: 3/4 + bracket_position_number: 1 + loser1_name: Loser of 4010 + loser2_name: Loser of 4011 + round: 6 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_6010: + tournament_id: 1 + weight_id: 5 + bout_number: 6010 + w1: + w2: + bracket_position: 5/6 + bracket_position_number: 1 + loser1_name: + loser2_name: + round: 6 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_6011: + tournament_id: 1 + weight_id: 5 + bout_number: 6011 + w1: + w2: + bracket_position: 7/8 + bracket_position_number: 1 + loser1_name: Loser of 4012 + loser2_name: Loser of 4013 + round: 6 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1021: + tournament_id: 1 + weight_id: 6 + bout_number: 1021 + w1: 50 + w2: 53 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_1022: + tournament_id: 1 + weight_id: 6 + bout_number: 1022 + w1: 51 + w2: 49 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 1 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2020: + tournament_id: 1 + weight_id: 6 + bout_number: 2020 + w1: 52 + w2: 49 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_2021: + tournament_id: 1 + weight_id: 6 + bout_number: 2021 + w1: 50 + w2: 51 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 2 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3020: + tournament_id: 1 + weight_id: 6 + bout_number: 3020 + w1: 53 + w2: 51 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_3021: + tournament_id: 1 + weight_id: 6 + bout_number: 3021 + w1: 52 + w2: 50 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 3 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_4014: + tournament_id: 1 + weight_id: 6 + bout_number: 4014 + w1: 49 + w2: 50 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 4 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_4015: + tournament_id: 1 + weight_id: 6 + bout_number: 4015 + w1: 53 + w2: 52 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 4 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_5008: + tournament_id: 1 + weight_id: 6 + bout_number: 5008 + w1: 51 + w2: 52 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 5 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: + +tournament_1_bout_5009: + tournament_id: 1 + weight_id: 6 + bout_number: 5009 + w1: 49 + w2: 53 + bracket_position: Pool + bracket_position_number: + loser1_name: + loser2_name: + round: 5 + mat_id: + finished: + w1_stat: + w2_stat: + score: + winner_id: + win_type: \ No newline at end of file diff --git a/test/fixtures/wrestlers.yml b/test/fixtures/wrestlers.yml index d2f48af..56dfaff 100644 --- a/test/fixtures/wrestlers.yml +++ b/test/fixtures/wrestlers.yml @@ -1,531 +1,637 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -wrestler1: +tournament_1_wrestler_1: id: 1 name: Jackson Lakso school_id: 1 weight_id: 1 original_seed: 3 + seed: 2 season_loss: 8 season_win: 30 criteria: SQ + extra: -wrestler2: +tournament_1_wrestler_2: id: 2 name: JD Woods school_id: 1 weight_id: 1 original_seed: 5 + seed: 5 season_loss: 12 season_win: 30 criteria: DP 6th + extra: -wrestler3: +tournament_1_wrestler_3: id: 3 name: Jaden Mattox school_id: 1 weight_id: 1 original_seed: 1 + seed: 1 season_loss: 3 season_win: 49 criteria: SP 2nd + extra: -wrestler4: +tournament_1_wrestler_4: id: 4 name: Zach Collins school_id: 1 weight_id: 1 original_seed: 4 + seed: 4 season_loss: 8 season_win: 30 criteria: DP 5th + extra: -wrestler5: +tournament_1_wrestler_5: id: 5 name: James Wimer school_id: 1 weight_id: 1 original_seed: 2 + seed: 3 season_loss: 12 season_win: 49 criteria: SP 5th + extra: -wrestler6: +tournament_1_wrestler_6: id: 6 name: Derek Wurzauf school_id: 1 weight_id: 2 original_seed: 6 + seed: 3 season_loss: 15 season_win: 16 criteria: + extra: -wrestler7: +tournament_1_wrestler_7: id: 7 name: Casey Davis school_id: 1 weight_id: 2 original_seed: 5 + seed: 5 season_loss: 15 season_win: 16 criteria: DQ + extra: -wrestler8: +tournament_1_wrestler_8: id: 8 name: Kameron Teacher school_id: 1 weight_id: 2 original_seed: 2 + seed: 2 season_loss: 2 season_win: 50 criteria: SQ + extra: -wrestler9: +tournament_1_wrestler_9: id: 9 name: Robbie Fusner school_id: 1 weight_id: 2 original_seed: 3 + seed: 6 season_loss: 5 season_win: 40 criteria: SQ + extra: -wrestler10: +tournament_1_wrestler_10: id: 10 name: Guy1 school_id: 1 weight_id: 2 original_seed: 7 + seed: 4 season_loss: 2 season_win: 50 criteria: + extra: -wrestler11: +tournament_1_wrestler_11: id: 11 name: Ethan Leapley school_id: 1 weight_id: 2 original_seed: 4 + seed: 7 season_loss: 15 season_win: 20 criteria: DP 6th + extra: -wrestler12: +tournament_1_wrestler_12: id: 12 name: Clayton Ray school_id: 1 weight_id: 2 original_seed: 1 + seed: 1 season_loss: 4 season_win: 30 criteria: SP 7th + extra: -wrestler13: +tournament_1_wrestler_13: id: 13 name: Guy2 school_id: 1 weight_id: 3 original_seed: 1 + seed: 1 season_loss: 2 season_win: 50 criteria: + extra: -wrestler14: +tournament_1_wrestler_14: id: 14 name: Guy9 school_id: 1 weight_id: 3 original_seed: 8 + seed: 3 season_loss: 2 season_win: 50 criteria: + extra: -wrestler15: +tournament_1_wrestler_15: id: 15 name: Guy7 school_id: 1 weight_id: 3 original_seed: 6 + seed: 6 season_loss: 2 season_win: 50 criteria: + extra: -wrestler16: +tournament_1_wrestler_16: id: 16 name: Guy3 school_id: 1 weight_id: 3 original_seed: 2 + seed: 2 season_loss: 2 season_win: 50 criteria: + extra: -wrestler17: +tournament_1_wrestler_17: id: 17 name: Guy4 school_id: 1 weight_id: 3 original_seed: 3 + seed: 8 season_loss: 2 season_win: 50 criteria: + extra: -wrestler18: +tournament_1_wrestler_18: id: 18 name: Guy8 school_id: 1 weight_id: 3 original_seed: 7 + seed: 7 season_loss: 2 season_win: 50 criteria: + extra: -wrestler19: +tournament_1_wrestler_19: id: 19 name: Guy10 school_id: 1 weight_id: 3 original_seed: 9 + seed: 4 season_loss: 2 season_win: 50 criteria: + extra: -wrestler20: +tournament_1_wrestler_20: id: 20 name: Guy6 school_id: 1 weight_id: 3 original_seed: 5 + seed: 5 season_loss: 2 season_win: 50 criteria: + extra: -wrestler21: +tournament_1_wrestler_21: id: 21 name: Guy5 school_id: 1 weight_id: 3 original_seed: 4 + seed: 9 season_loss: 2 season_win: 50 criteria: + extra: -wrestler22: +tournament_1_wrestler_22: id: 22 name: Guy20 school_id: 1 weight_id: 4 original_seed: 10 + seed: 7 season_loss: 2 season_win: 50 criteria: + extra: -wrestler23: +tournament_1_wrestler_23: id: 23 name: Guy12 school_id: 1 weight_id: 4 original_seed: 2 + seed: 2 season_loss: 2 season_win: 50 criteria: + extra: -wrestler24: +tournament_1_wrestler_24: id: 24 name: Guy16 school_id: 1 weight_id: 4 original_seed: 6 + seed: 6 season_loss: 2 season_win: 50 criteria: + extra: -wrestler25: +tournament_1_wrestler_25: id: 25 name: Guy13 school_id: 1 weight_id: 4 original_seed: 3 + seed: 3 season_loss: 2 season_win: 50 criteria: + extra: -wrestler26: +tournament_1_wrestler_26: id: 26 name: Guy15 school_id: 1 weight_id: 4 original_seed: 5 + seed: 5 season_loss: 2 season_win: 50 criteria: + extra: -wrestler27: +tournament_1_wrestler_27: id: 27 name: Guy21 school_id: 1 weight_id: 4 original_seed: 11 + seed: 8 season_loss: 2 season_win: 50 criteria: + extra: -wrestler28: +tournament_1_wrestler_28: id: 28 name: Guy11 school_id: 1 weight_id: 4 original_seed: 1 + seed: 1 season_loss: 2 season_win: 50 criteria: + extra: -wrestler29: +tournament_1_wrestler_29: id: 29 name: Guy14 school_id: 1 weight_id: 4 original_seed: 4 + seed: 4 season_loss: 2 season_win: 50 criteria: + extra: -wrestler30: +tournament_1_wrestler_30: id: 30 name: Guy18 school_id: 1 weight_id: 4 original_seed: 8 + seed: 11 season_loss: 2 season_win: 50 criteria: + extra: -wrestler31: +tournament_1_wrestler_31: id: 31 name: Guy17 school_id: 1 weight_id: 4 original_seed: 7 + seed: 10 season_loss: 2 season_win: 50 criteria: + extra: -wrestler32: +tournament_1_wrestler_32: id: 32 name: Guy19 school_id: 1 weight_id: 4 original_seed: 9 + seed: 9 season_loss: 2 season_win: 50 criteria: + extra: -wrestler33: +tournament_1_wrestler_33: id: 33 name: Guy36 school_id: 1 weight_id: 5 original_seed: 15 + seed: 7 season_loss: 2 season_win: 50 criteria: + extra: -wrestler34: +tournament_1_wrestler_34: id: 34 name: Guy31 school_id: 1 weight_id: 5 original_seed: 10 + seed: 10 season_loss: 2 season_win: 50 criteria: + extra: -wrestler35: +tournament_1_wrestler_35: id: 35 name: Guy22 school_id: 1 weight_id: 5 original_seed: 1 + seed: 1 season_loss: 2 season_win: 50 criteria: + extra: -wrestler36: +tournament_1_wrestler_36: id: 36 name: Guy32 school_id: 1 weight_id: 5 original_seed: 11 + seed: 11 season_loss: 2 season_win: 50 criteria: + extra: -wrestler37: +tournament_1_wrestler_37: id: 37 name: Guy23 school_id: 1 weight_id: 5 original_seed: 2 + seed: 2 season_loss: 2 season_win: 50 criteria: + extra: -wrestler38: +tournament_1_wrestler_38: id: 38 name: Guy34 school_id: 1 weight_id: 5 original_seed: 13 + seed: 13 season_loss: 2 season_win: 50 criteria: + extra: -wrestler39: +tournament_1_wrestler_39: id: 39 name: Guy29 school_id: 1 weight_id: 5 original_seed: 8 + seed: 16 season_loss: 2 season_win: 50 criteria: + extra: -wrestler40: +tournament_1_wrestler_40: id: 40 name: Guy26 school_id: 1 weight_id: 5 original_seed: 5 + seed: 5 season_loss: 2 season_win: 50 criteria: + extra: -wrestler41: +tournament_1_wrestler_41: id: 41 name: Guy35 school_id: 1 weight_id: 5 original_seed: 14 + seed: 6 season_loss: 2 season_win: 50 criteria: + extra: -wrestler42: +tournament_1_wrestler_42: id: 42 name: Guy30 school_id: 1 weight_id: 5 original_seed: 9 + seed: 9 season_loss: 2 season_win: 50 criteria: + extra: -wrestler43: +tournament_1_wrestler_43: id: 43 name: Guy27 school_id: 1 weight_id: 5 original_seed: 6 + seed: 14 season_loss: 2 season_win: 50 criteria: + extra: -wrestler44: +tournament_1_wrestler_44: id: 44 name: Guy28 school_id: 1 weight_id: 5 original_seed: 7 + seed: 15 season_loss: 2 season_win: 50 criteria: + extra: -wrestler45: +tournament_1_wrestler_45: id: 45 name: Guy37 school_id: 1 weight_id: 5 original_seed: 16 + seed: 8 season_loss: 2 season_win: 50 criteria: + extra: -wrestler46: +tournament_1_wrestler_46: id: 46 name: Guy33 school_id: 1 weight_id: 5 original_seed: 12 + seed: 12 season_loss: 2 season_win: 50 criteria: + extra: -wrestler47: +tournament_1_wrestler_47: id: 47 name: Guy24 school_id: 1 weight_id: 5 original_seed: 3 + seed: 3 season_loss: 2 season_win: 50 criteria: + extra: -wrestler48: +tournament_1_wrestler_48: id: 48 name: Guy25 school_id: 1 weight_id: 5 original_seed: 4 + seed: 4 season_loss: 2 season_win: 50 criteria: + extra: -wrestler49: +tournament_1_wrestler_49: id: 49 name: Guy42 school_id: 1 weight_id: 6 original_seed: + seed: 4 season_loss: 2 season_win: 50 criteria: + extra: -wrestler50: +tournament_1_wrestler_50: id: 50 name: Guy39 school_id: 1 weight_id: 6 original_seed: 2 + seed: 2 season_loss: 2 season_win: 50 criteria: + extra: -wrestler51: +tournament_1_wrestler_51: id: 51 name: Guy41 school_id: 1 weight_id: 6 original_seed: + seed: 3 season_loss: 2 season_win: 50 criteria: + extra: -wrestler52: +tournament_1_wrestler_52: id: 52 name: Guy43 school_id: 1 weight_id: 6 original_seed: + seed: 5 season_loss: 2 season_win: 50 criteria: + extra: -wrestler53: +tournament_1_wrestler_53: id: 53 name: Guy40 school_id: 1 weight_id: 6 original_seed: + seed: 6 season_loss: 2 season_win: 50 - criteria: \ No newline at end of file + criteria: + extra: \ No newline at end of file diff --git a/test/integration/pool_advancement_test.rb b/test/integration/pool_advancement_test.rb index 5df311a..502e27c 100644 --- a/test/integration/pool_advancement_test.rb +++ b/test/integration/pool_advancement_test.rb @@ -7,7 +7,7 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest # WHY DOES THIS NOT WORK WITHOUT GENERATING MATCHUPS BEFORE EVERY TEST? # FIXTURES FOR MATCHES ARE FILLED OUT AND WORK FOR OTHER TESTS - tournament.generateMatchups + # tournament.generateMatchups end def singlePoolNotFinished diff --git a/test/integration/single_test_test.rb b/test/integration/single_test_test.rb index 32a5519..919fda3 100644 --- a/test/integration/single_test_test.rb +++ b/test/integration/single_test_test.rb @@ -36,7 +36,8 @@ class SingleTestTest < ActionDispatch::IntegrationTest # Yml for wrestlers # @tournament.wrestlers.each do |w| - # puts "tournament_1_#{w.name}:" + # puts "tournament_1_wrestler_#{count}:" + # puts " id: #{count}" # puts " name: #{w.name}" # puts " school_id: #{w.school_id}" # puts " weight_id: #{w.weight_id}" @@ -45,6 +46,7 @@ class SingleTestTest < ActionDispatch::IntegrationTest # puts " season_loss: #{w.season_loss}" # puts " season_win: #{w.season_win}" # puts " criteria: #{w.criteria}" + # puts " extra: #{w.extra}" # puts "" # count += 1 # end From 2f9c54df2e7dcc4f82bf8a9a5c9bbff3dc510f87 Mon Sep 17 00:00:00 2001 From: jcwimer Date: Sat, 14 May 2016 13:28:28 +0000 Subject: [PATCH 2/3] Refactored match generation so I can eventually support multiple types of tournaments --- app/controllers/tournaments_controller.rb | 2 +- app/models/generates_tournament_matches.rb | 60 ------------------ app/models/tournament.rb | 19 ------ app/models/weight.rb | 49 --------------- .../generate_tournament_matches.rb | 61 +++++++++++++++++++ .../pool_bracket_generation.rb} | 2 +- .../tournament_services/pool_generation.rb} | 2 +- .../pool_to_bracket_generate_loser_names.rb} | 19 +++--- .../pool_to_bracket_match_generation.rb | 46 ++++++++++++++ .../tournament_services/tournament_seeding.rb | 44 +++++++++++++ .../wipe_tournament_matches.rb | 19 ++++++ config/application.rb | 2 + test/integration/pool_advancement_test.rb | 4 -- test/integration/poolbracket_matchups_test.rb | 4 +- 14 files changed, 189 insertions(+), 144 deletions(-) delete mode 100644 app/models/generates_tournament_matches.rb create mode 100644 app/services/tournament_services/generate_tournament_matches.rb rename app/{models/pool_bracket.rb => services/tournament_services/pool_bracket_generation.rb} (98%) rename app/{models/pool.rb => services/tournament_services/pool_generation.rb} (96%) rename app/{models/generates_loser_names.rb => services/tournament_services/pool_to_bracket_generate_loser_names.rb} (92%) create mode 100644 app/services/tournament_services/pool_to_bracket_match_generation.rb create mode 100644 app/services/tournament_services/tournament_seeding.rb create mode 100644 app/services/tournament_services/wipe_tournament_matches.rb diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index b06c577..b89d609 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -163,7 +163,7 @@ class TournamentsController < ApplicationController end def generate_matches - @tournament.generateMatchups + GenerateTournamentMatches.new(@tournament).generate end def brackets diff --git a/app/models/generates_tournament_matches.rb b/app/models/generates_tournament_matches.rb deleted file mode 100644 index 7661a64..0000000 --- a/app/models/generates_tournament_matches.rb +++ /dev/null @@ -1,60 +0,0 @@ -module GeneratesTournamentMatches - - def generateMatchups - self.curently_generating_matches = 1 - self.save - resetSchoolScores - setSeedsAndRandomSeedingWrestlersWithoutSeeds - poolToBracket() if tournament_type == "Pool to bracket" - self.curently_generating_matches = nil - self.save - end - if Rails.env.production? - handle_asynchronously :generateMatchups - end - - def poolToBracket - destroyAllMatches - generatePoolToBracketMatches - poolToBracketPostMatchCreation - end - - def generatePoolToBracketMatches - weights.order(:max).each do |weight| - Pool.new(weight).generatePools() - last_match = matches.where(weight: weight).order(round: :desc).limit(1).first - highest_round = last_match.round - PoolBracket.new(weight, highest_round).generateBracketMatches() - end - end - - def poolToBracketPostMatchCreation - moveFinalsMatchesToLastRound - assignBouts - assignLoserNames - assignFirstMatchesToMats - movePoolSeedsToFinalPoolRound - end - - def moveFinalsMatchesToLastRound - finalsRound = self.totalRounds - finalsMatches = self.matches.select{|m| m.bracket_position == "1/2" || m.bracket_position == "3/4" || m.bracket_position == "5/6" || m.bracket_position == "7/8"} - finalsMatches. each do |m| - m.round = finalsRound - m.save - end - end - - def setSeedsAndRandomSeedingWrestlersWithoutSeeds - weights.each do |w| - w.setSeeds - end - end - - def movePoolSeedsToFinalPoolRound - self.weights.each do |w| - w.setOriginalSeedsToWrestleLastPoolRound - end - end - -end diff --git a/app/models/tournament.rb b/app/models/tournament.rb index e1224f3..19dff17 100644 --- a/app/models/tournament.rb +++ b/app/models/tournament.rb @@ -1,7 +1,5 @@ class Tournament < ActiveRecord::Base - include GeneratesLoserNames - include GeneratesTournamentMatches belongs_to :user has_many :schools, dependent: :destroy has_many :weights, dependent: :destroy @@ -24,10 +22,6 @@ class Tournament < ActiveRecord::Base time end - def resetSchoolScores - schools.update_all("score = 0.0") - end - def tournament_types ["Pool to bracket"] end @@ -50,19 +44,6 @@ class Tournament < ActiveRecord::Base def matchesByRound(round) matches.joins(:weight).where(round: round).order("weights.max") end - - def assignBouts - bout_counts = Hash.new(0) - matches.each do |m| - m.bout_number = m.round * 1000 + bout_counts[m.round] - bout_counts[m.round] += 1 - m.save! - end - end - - def assignFirstMatchesToMats - assignMats(mats) - end def totalRounds self.matches.sort_by{|m| m.round}.last.round diff --git a/app/models/weight.rb b/app/models/weight.rb index 824a103..1573b19 100644 --- a/app/models/weight.rb +++ b/app/models/weight.rb @@ -46,22 +46,6 @@ class Weight < ActiveRecord::Base wrestlersForPool(pool).sort_by{|w| [w.original_seed ? 0 : 1, w.original_seed || 0]} end - def setOriginalSeedsToWrestleLastPoolRound - pool = 1 - until pool > self.pools - wrestler1 = poolSeedOrder(pool).first - wrestler2 = poolSeedOrder(pool).second - match = wrestler1.poolMatches.sort_by{|m| m.round}.last - if match.w1 != wrestler2.id or match.w2 != wrestler2.id - if match.w1 == wrestler1.id - swapWrestlers(match.w2,wrestler2.id) - elsif match.w2 == wrestler1.id - swapWrestlers(match.w1,wrestler2.id) - end - end - pool += 1 - end - end def swapWrestlers(wrestler1_id,wrestler2_id) SwapWrestlers.new.swapWrestlers(wrestler1_id,wrestler2_id) @@ -180,38 +164,5 @@ class Weight < ActiveRecord::Base def poolOrder(pool) PoolOrder.new(wrestlersForPool(pool)).getPoolOrder end - - def randomSeeding - wrestlerWithSeeds = self.wrestlers.select{|w| w.original_seed != nil }.sort_by{|w| w.original_seed} - if wrestlerWithSeeds.size > 0 - highestSeed = wrestlerWithSeeds.last.seed - seed = highestSeed + 1 - else - seed = 1 - end - wrestlersWithoutSeed = self.wrestlers.select{|w| w.original_seed == nil } - wrestlersWithoutSeed.shuffle.each do |w| - w.seed = seed - w.save - seed += 1 - end - end - - def setSeeds - resetAllSeeds - wrestlerWithSeeds = self.wrestlers.select{|w| w.original_seed != nil } - wrestlerWithSeeds.each do |w| - w.seed = w.original_seed - w.save - end - randomSeeding - end - - def resetAllSeeds - self.wrestlers.each do |w| - w.seed = nil - w.save - end - end end diff --git a/app/services/tournament_services/generate_tournament_matches.rb b/app/services/tournament_services/generate_tournament_matches.rb new file mode 100644 index 0000000..4ffdb34 --- /dev/null +++ b/app/services/tournament_services/generate_tournament_matches.rb @@ -0,0 +1,61 @@ +class GenerateTournamentMatches + def initialize( tournament ) + @tournament = tournament + end + + def generate + standardStartingActions + PoolToBracketMatchGeneration.new(@tournament).generatePoolToBracketMatches if @tournament.tournament_type == "Pool to bracket" + postMatchCreationActions + PoolToBracketMatchGeneration.new(@tournament).assignLoserNames if @tournament.tournament_type == "Pool to bracket" + end + + def standardStartingActions + @tournament.curently_generating_matches = 1 + @tournament.save + WipeTournamentMatches.new(@tournament).setUpMatchGeneration + TournamentSeeding.new(@tournament).setSeeds + end + + def postMatchCreationActions + moveFinalsMatchesToLastRound + assignBouts + assignFirstMatchesToMats + @tournament.curently_generating_matches = nil + @tournament.save + end + + def assignBouts + bout_counts = Hash.new(0) + @tournament.matches.each do |m| + m.bout_number = m.round * 1000 + bout_counts[m.round] + bout_counts[m.round] += 1 + m.save! + end + end + + def moveFinalsMatchesToLastRound + finalsRound = @tournament.totalRounds + finalsMatches = @tournament.matches.select{|m| m.bracket_position == "1/2" || m.bracket_position == "3/4" || m.bracket_position == "5/6" || m.bracket_position == "7/8"} + finalsMatches. each do |m| + m.round = finalsRound + m.save + end + end + + def assignFirstMatchesToMats + matsToAssign = @tournament.mats + if matsToAssign.count > 0 + until matsToAssign.sort_by{|m| m.id}.last.matches.count == 4 + matsToAssign.sort_by{|m| m.id}.each do |m| + m.assignNextMatch + end + end + end + end + + + + + +end \ No newline at end of file diff --git a/app/models/pool_bracket.rb b/app/services/tournament_services/pool_bracket_generation.rb similarity index 98% rename from app/models/pool_bracket.rb rename to app/services/tournament_services/pool_bracket_generation.rb index 26be9f4..4b42763 100644 --- a/app/models/pool_bracket.rb +++ b/app/services/tournament_services/pool_bracket_generation.rb @@ -1,4 +1,4 @@ -class PoolBracket +class PoolBracketGeneration def initialize(weight, highest_round) @weight = weight diff --git a/app/models/pool.rb b/app/services/tournament_services/pool_generation.rb similarity index 96% rename from app/models/pool.rb rename to app/services/tournament_services/pool_generation.rb index 8e7a3af..12a3e5c 100644 --- a/app/models/pool.rb +++ b/app/services/tournament_services/pool_generation.rb @@ -1,4 +1,4 @@ -class Pool +class PoolGeneration def initialize(weight) @weight = weight @tournament = @weight.tournament diff --git a/app/models/generates_loser_names.rb b/app/services/tournament_services/pool_to_bracket_generate_loser_names.rb similarity index 92% rename from app/models/generates_loser_names.rb rename to app/services/tournament_services/pool_to_bracket_generate_loser_names.rb index 023eb12..d315c04 100644 --- a/app/models/generates_loser_names.rb +++ b/app/services/tournament_services/pool_to_bracket_generate_loser_names.rb @@ -1,8 +1,12 @@ -module GeneratesLoserNames - def assignLoserNames +class PoolToBracketGenerateLoserNames + def initialize( tournament ) + @tournament = tournament + end + + def assignLoserNames matches_by_weight = nil - weights.each do |w| - matches_by_weight = matches.where(weight_id: w.id) + @tournament.weights.each do |w| + matches_by_weight = @tournament.matches.where(weight_id: w.id) if w.pool_bracket_type == "twoPoolsToSemi" twoPoolsToSemiLoser(matches_by_weight) elsif w.pool_bracket_type == "fourPoolsToQuarter" @@ -12,7 +16,7 @@ module GeneratesLoserNames end saveMatches(matches_by_weight) end - end + end def twoPoolsToSemiLoser(matches_by_weight) match1 = matches_by_weight.select{|m| m.loser1_name == "Winner Pool 1"}.first @@ -59,5 +63,6 @@ module GeneratesLoserNames matches.each do |m| m.save! end - end -end + end + +end \ No newline at end of file diff --git a/app/services/tournament_services/pool_to_bracket_match_generation.rb b/app/services/tournament_services/pool_to_bracket_match_generation.rb new file mode 100644 index 0000000..31e9388 --- /dev/null +++ b/app/services/tournament_services/pool_to_bracket_match_generation.rb @@ -0,0 +1,46 @@ +class PoolToBracketMatchGeneration + def initialize( tournament ) + @tournament = tournament + end + + + + def generatePoolToBracketMatches + @tournament.weights.order(:max).each do |weight| + PoolGeneration.new(weight).generatePools() + last_match = @tournament.matches.where(weight: weight).order(round: :desc).limit(1).first + highest_round = last_match.round + PoolBracketGeneration.new(weight, highest_round).generateBracketMatches() + end + movePoolSeedsToFinalPoolRound + end + + def movePoolSeedsToFinalPoolRound + @tournament.weights.each do |w| + setOriginalSeedsToWrestleLastPoolRound(w) + end + end + + 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 + if match.w1 != wrestler2.id or match.w2 != wrestler2.id + if match.w1 == wrestler1.id + SwapWrestlers.new.swapWrestlers(match.w2,wrestler2.id) + elsif match.w2 == wrestler1.id + SwapWrestlers.new.swapWrestlers(match.w1,wrestler2.id) + end + end + pool += 1 + end + end + + + def assignLoserNames + PoolToBracketGenerateLoserNames.new(@tournament).assignLoserNames + end + +end \ No newline at end of file diff --git a/app/services/tournament_services/tournament_seeding.rb b/app/services/tournament_services/tournament_seeding.rb new file mode 100644 index 0000000..4ffb9aa --- /dev/null +++ b/app/services/tournament_services/tournament_seeding.rb @@ -0,0 +1,44 @@ +class TournamentSeeding + def initialize( tournament ) + @tournament = tournament + end + + def setSeeds + @tournament.weights.each do |w| + resetAllSeeds(w) + setOriginalSeeds(w) + randomSeeding(w) + end + end + + def randomSeeding(weight) + wrestlerWithSeeds = weight.wrestlers.select{|w| w.original_seed != nil }.sort_by{|w| w.original_seed} + if wrestlerWithSeeds.size > 0 + highestSeed = wrestlerWithSeeds.last.seed + seed = highestSeed + 1 + else + seed = 1 + end + wrestlersWithoutSeed = weight.wrestlers.select{|w| w.original_seed == nil } + wrestlersWithoutSeed.shuffle.each do |w| + w.seed = seed + w.save + seed += 1 + end + end + + def setOriginalSeeds(weight) + wrestlerWithSeeds = weight.wrestlers.select{|w| w.original_seed != nil } + wrestlerWithSeeds.each do |w| + w.seed = w.original_seed + w.save + end + end + + def resetAllSeeds(weight) + weight.wrestlers.each do |w| + w.seed = nil + w.save + end + end +end \ No newline at end of file diff --git a/app/services/tournament_services/wipe_tournament_matches.rb b/app/services/tournament_services/wipe_tournament_matches.rb new file mode 100644 index 0000000..e77c0cb --- /dev/null +++ b/app/services/tournament_services/wipe_tournament_matches.rb @@ -0,0 +1,19 @@ +class WipeTournamentMatches + + def initialize( tournament ) + @tournament = tournament + end + + def setUpMatchGeneration + wipeMatches + resetSchoolScores + end + + def wipeMatches + @tournament.matches.destroy_all + end + + def resetSchoolScores + @tournament.schools.update_all("score = 0.0") + end +end \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index 786352b..a05c52e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -34,6 +34,8 @@ module Wrestling config.to_prepare do DeviseController.respond_to :html, :json end + + config.autoload_paths += %W(#{config.root}/app/services/tournament_services) end diff --git a/test/integration/pool_advancement_test.rb b/test/integration/pool_advancement_test.rb index 502e27c..cb5382c 100644 --- a/test/integration/pool_advancement_test.rb +++ b/test/integration/pool_advancement_test.rb @@ -4,10 +4,6 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest def setup tournament = Tournament.find(1) - - # WHY DOES THIS NOT WORK WITHOUT GENERATING MATCHUPS BEFORE EVERY TEST? - # FIXTURES FOR MATCHES ARE FILLED OUT AND WORK FOR OTHER TESTS - # tournament.generateMatchups end def singlePoolNotFinished diff --git a/test/integration/poolbracket_matchups_test.rb b/test/integration/poolbracket_matchups_test.rb index 0279a91..5946be3 100644 --- a/test/integration/poolbracket_matchups_test.rb +++ b/test/integration/poolbracket_matchups_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class PoolbracketMatchupsTest < ActionDispatch::IntegrationTest def setup @tournament = Tournament.find(1) - @tournament.generateMatchups + GenerateTournamentMatches.new(@tournament).generate end def createTournament(numberOfWrestlers) @@ -69,7 +69,7 @@ class PoolbracketMatchupsTest < ActionDispatch::IntegrationTest end def checkForByeInPool(tournament) - tournament.generateMatchups + GenerateTournamentMatches.new(tournament).generate matchups = tournament.matches tournament.weights.each do |w| w.wrestlers.each do |wr| From a6e64bdf8f4a21c222939bb253a8b5dc2d021bb0 Mon Sep 17 00:00:00 2001 From: jcwimer Date: Sat, 14 May 2016 14:54:49 +0000 Subject: [PATCH 3/3] Moved none database classes out of model folder. Still need to separate classes that are doing too much for bracket_advancement, for placement points, and for swapping wrestlers in pool/bracket. --- app/{models => services/bracket_advancement}/pool_advance.rb | 0 app/{models => services/bracket_advancement}/pool_order.rb | 0 .../wrestler_services}/pool_bracket_placement_points.rb | 0 app/{models => services/wrestler_services}/swap_wrestlers.rb | 0 config/application.rb | 2 ++ 5 files changed, 2 insertions(+) rename app/{models => services/bracket_advancement}/pool_advance.rb (100%) rename app/{models => services/bracket_advancement}/pool_order.rb (100%) rename app/{models => services/wrestler_services}/pool_bracket_placement_points.rb (100%) rename app/{models => services/wrestler_services}/swap_wrestlers.rb (100%) diff --git a/app/models/pool_advance.rb b/app/services/bracket_advancement/pool_advance.rb similarity index 100% rename from app/models/pool_advance.rb rename to app/services/bracket_advancement/pool_advance.rb diff --git a/app/models/pool_order.rb b/app/services/bracket_advancement/pool_order.rb similarity index 100% rename from app/models/pool_order.rb rename to app/services/bracket_advancement/pool_order.rb diff --git a/app/models/pool_bracket_placement_points.rb b/app/services/wrestler_services/pool_bracket_placement_points.rb similarity index 100% rename from app/models/pool_bracket_placement_points.rb rename to app/services/wrestler_services/pool_bracket_placement_points.rb diff --git a/app/models/swap_wrestlers.rb b/app/services/wrestler_services/swap_wrestlers.rb similarity index 100% rename from app/models/swap_wrestlers.rb rename to app/services/wrestler_services/swap_wrestlers.rb diff --git a/config/application.rb b/config/application.rb index a05c52e..83f26e4 100644 --- a/config/application.rb +++ b/config/application.rb @@ -36,6 +36,8 @@ module Wrestling end config.autoload_paths += %W(#{config.root}/app/services/tournament_services) + config.autoload_paths += %W(#{config.root}/app/services/wrestler_services) + config.autoload_paths += %W(#{config.root}/app/services/bracket_advancement) end