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

Fixed a number of N+1 issues on low traffic pages. I also added relevant html tests for these pages.

This commit is contained in:
2026-02-17 22:27:11 -05:00
parent d359be3ea1
commit 8670ce38c3
16 changed files with 330 additions and 103 deletions

View File

@@ -119,16 +119,17 @@
<% @weights.sort_by{|w| w.max}.each do |weight| %>
<% if @tournament.tournament_type == "Pool to bracket" %>
<!-- Need to define what the tournaments#bracket controller defines -->
<% @matches = @tournament.matches.select{|m| m.weight_id == weight.id} %>
<% @wrestlers = Wrestler.where(weight_id: weight.id) %>
<% @matches = @matches_by_weight_id[weight.id] || [] %>
<% @wrestlers = @wrestlers_by_weight_id[weight.id] || [] %>
<% @pools = weight.pool_rounds(@matches) %>
<% @weight = weight %>
<%= render 'bracket_partial' %>
<% elsif @tournament.tournament_type.include? "Modified 16 Man Double Elimination" or @tournament.tournament_type.include? "Regular Double Elimination" %>
<!-- Need to define what the tournaments#bracket controller defines -->
<% @matches = weight.matches %>
<% @matches = @matches_by_weight_id[weight.id] || [] %>
<% @wrestlers = @wrestlers_by_weight_id[weight.id] || [] %>
<% @weight = weight %>
<%= render 'bracket_partial' %>
<% end %>
<% end %>
<% end %>
<% end %>