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

Discard ActiveRecord association cache so generating a single weight class of matches works

This commit is contained in:
2018-01-31 07:59:48 -05:00
parent 53598152cf
commit 9841f5648d

View File

@@ -43,6 +43,7 @@ class GenerateTournamentMatches
def assignBouts
bout_counts = Hash.new(0)
@tournament.matches.reload
@tournament.matches.sort_by{|m| [m.round, m.weight_max]}.each do |m|
m.bout_number = m.round * 1000 + bout_counts[m.round]
bout_counts[m.round] += 1