From a52d2c6b709cfbdf1789a187543ac1e776c0186f Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Fri, 2 Feb 2018 08:17:04 -0500 Subject: [PATCH] Reload tournament matches so generateweight moves finals to the last round as well --- app/services/tournament_services/generate_tournament_matches.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/tournament_services/generate_tournament_matches.rb b/app/services/tournament_services/generate_tournament_matches.rb index 02e8751..35fef43 100644 --- a/app/services/tournament_services/generate_tournament_matches.rb +++ b/app/services/tournament_services/generate_tournament_matches.rb @@ -54,7 +54,7 @@ class GenerateTournamentMatches 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 = @tournament.matches.reload.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