1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Reload tournament matches so generateweight moves finals to the last round as well

This commit is contained in:
2018-02-02 08:17:04 -05:00
parent b2ab1e0be1
commit 45a7ab3e6c

View File

@@ -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