1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-05 22:21:26 +00:00

New bracket positions for double elim brackets. Each bracket position will now wrestle during the same round. Made a rake task to migrate previous matches to the new bracket positions.

This commit is contained in:
2025-04-02 16:23:20 -04:00
parent f32e711d2b
commit 9c25a6cc39
29 changed files with 1138 additions and 756 deletions

View File

@@ -164,7 +164,7 @@ class Weight < ApplicationRecord
end
def highest_bracket_round
bracket_matches_sorted_by_round_descending = matches.select{|m| m.bracket_position == "Bracket"}.sort_by{|m| m.round}.reverse
bracket_matches_sorted_by_round_descending = matches.select{|m| m.bracket_position.include? "Bracket"}.sort_by{|m| m.round}.reverse
if bracket_matches_sorted_by_round_descending.size > 0
return bracket_matches_sorted_by_round_descending.first.round
else
@@ -172,12 +172,30 @@ class Weight < ApplicationRecord
end
end
def lowest_bracket_round
bracket_matches_sorted_by_round_ascending = matches.select{|m| m.bracket_position.include? "Bracket"}.sort_by{|m| m.round}
if bracket_matches_sorted_by_round_ascending.size > 0
return bracket_matches_sorted_by_round_ascending.first.round
else
return nil
end
end
def highest_conso_round
conso_matches_sorted_by_round_descending = matches.select{|m| m.bracket_position == "Conso"}.sort_by{|m| m.round}.reverse
conso_matches_sorted_by_round_descending = matches.select{|m| m.bracket_position.include? "Conso"}.sort_by{|m| m.round}.reverse
if conso_matches_sorted_by_round_descending.size > 0
return conso_matches_sorted_by_round_descending.first.round
else
return nil
end
end
def lowest_conso_round
conso_matches_sorted_by_round_ascending = matches.select{|m| m.bracket_position.include? "Conso"}.sort_by{|m| m.round}
if conso_matches_sorted_by_round_ascending.size > 0
return conso_matches_sorted_by_round_ascending.first.round
else
return nil
end
end
end