mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Fixed double elimination generate loser names for a 6 man bracket when we're placing top 8
This commit is contained in:
@@ -6,11 +6,14 @@ class DoubleEliminationGenerateLoserNames
|
|||||||
# Entry point: assign loser placeholders and advance any byes
|
# Entry point: assign loser placeholders and advance any byes
|
||||||
def assign_loser_names
|
def assign_loser_names
|
||||||
@tournament.weights.each do |weight|
|
@tournament.weights.each do |weight|
|
||||||
|
# only assign loser names if there's conso matches to be had
|
||||||
|
if weight.calculate_bracket_size > 2
|
||||||
assign_loser_names_for_weight(weight)
|
assign_loser_names_for_weight(weight)
|
||||||
advance_bye_matches_championship(weight)
|
advance_bye_matches_championship(weight)
|
||||||
advance_bye_matches_consolation(weight)
|
advance_bye_matches_consolation(weight)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
@@ -87,7 +90,7 @@ class DoubleEliminationGenerateLoserNames
|
|||||||
end
|
end
|
||||||
|
|
||||||
# 5th/6th place
|
# 5th/6th place
|
||||||
if bracket_size >= 5 && num_placers >= 6
|
if bracket_size >= 5 && num_placers >= 6 && weight.wrestlers.size > 4
|
||||||
conso_semis = matches.select { |m| m.bracket_position == "Conso Semis" }
|
conso_semis = matches.select { |m| m.bracket_position == "Conso Semis" }
|
||||||
.sort_by(&:bracket_position_number)
|
.sort_by(&:bracket_position_number)
|
||||||
if conso_semis.size >= 2
|
if conso_semis.size >= 2
|
||||||
@@ -98,7 +101,7 @@ class DoubleEliminationGenerateLoserNames
|
|||||||
end
|
end
|
||||||
|
|
||||||
# 7th/8th place
|
# 7th/8th place
|
||||||
if bracket_size >= 7 && num_placers >= 8
|
if bracket_size >= 7 && num_placers >= 8 && weight.wrestlers.size > 6
|
||||||
conso_quarters = matches.select { |m| m.bracket_position == "Conso Quarter" }
|
conso_quarters = matches.select { |m| m.bracket_position == "Conso Quarter" }
|
||||||
.sort_by(&:bracket_position_number)
|
.sort_by(&:bracket_position_number)
|
||||||
if conso_quarters.size >= 2
|
if conso_quarters.size >= 2
|
||||||
|
|||||||
Reference in New Issue
Block a user