1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-12 16:59:00 +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

@@ -54,28 +54,28 @@
}
</style>
<% @matches.each do |match| %>
<% if match.w1 && match.w2 %>
<% w1 = Wrestler.find(match.w1) %>
<% w2 = Wrestler.find(match.w2) %>
<% end %>
<div class="pagebreak">
<p><strong>Bout Number:</strong> <%= match.bout_number %> <strong>Weight Class:</strong> <%= match.weight.max %> <strong>Round:</strong> <%= match.round %> <strong>Bracket Position:</strong> <%= match.bracket_position %></p>
<p><strong>Key: </strong>Takedown: T3, Escape: E1, Reversal: R2, Nearfall: N2 or N3 or N4, Stalling: S, Caution: C, Penalty Point: P1</p>
<% @matches.each do |match| %>
<% w1 = @wrestlers_by_id[match.w1] %>
<% w2 = @wrestlers_by_id[match.w2] %>
<% w1_name = w1&.name || match.loser1_name %>
<% w2_name = w2&.name || match.loser2_name %>
<div class="pagebreak">
<p><strong>Bout Number:</strong> <%= match.bout_number %> <strong>Weight Class:</strong> <%= match.weight.max %> <strong>Round:</strong> <%= match.round %> <strong>Bracket Position:</strong> <%= match.bracket_position %></p>
<p><strong>Key: </strong>Takedown: T3, Escape: E1, Reversal: R2, Nearfall: N2 or N3 or N4, Stalling: S, Caution: C, Penalty Point: P1</p>
<table>
<thead>
<tr class="small-row">
<th class="fixed-width">Circle Winner</th>
<th>
<p><%= match.w1_name %>-<%= w1&.school&.name %></p>
</th>
<th>
<p><%= match.w2_name %>-<%= w2&.school&.name %></p>
</th>
</tr>
</thead>
<th class="fixed-width">Circle Winner</th>
<th>
<p><%= w1_name %>-<%= w1&.school&.name %></p>
</th>
<th>
<p><%= w2_name %>-<%= w2&.school&.name %></p>
</th>
</tr>
</thead>
<tbody>
<tr class="small-row">
<td class="fixed-width"></td>