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

Realigned file and sorted matches by weight and round when assigning bouts

This commit is contained in:
2018-01-31 07:26:15 -05:00
parent 6d75d26f3b
commit 53598152cf

View File

@@ -43,7 +43,7 @@ class GenerateTournamentMatches
def assignBouts
bout_counts = Hash.new(0)
@tournament.matches.each do |m|
@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
m.save!