1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-06 14:36:59 +00:00

Fixed mat assignment rules to be db agnostic with comma delimited strings and upgraded test env db to mariadb 10.10 to match production.

This commit is contained in:
2025-01-25 20:02:22 -05:00
parent 54655a2ea9
commit 690e497654
8 changed files with 76 additions and 60 deletions

View File

@@ -5,30 +5,25 @@
<th>Weight Classes (Max)</th>
<th>Bracket Positions</th>
<th>Rounds</th>
<th><%= link_to ' New Mat Assignment Rule', new_tournament_mat_assignment_rule_path(@tournament), :class=>"fas fa-plus" %></th>
<th><%= link_to ' New Mat Assignment Rule', new_tournament_mat_assignment_rule_path(@tournament), class: "fas fa-plus" %></th>
</tr>
</thead>
<tbody>
<% @mat_assignment_rules.each do |rule| %>
<tr>
<td><%= rule.mat.name %></td>
<!-- Display max values for each weight associated with the rule -->
<td>
<% rule.weight_classes.each do |weight_id| %>
<% weight = @weights_by_id[weight_id] %>
<%= weight ? weight.max : "N/A" %><%= ", " unless weight_id == rule.weight_classes.last %>
<% Array(rule.weight_classes).each_with_index do |weight_id, index| %>
<% weight = @weights_by_id[weight_id.to_i] %>
<%= weight ? weight.max : "N/A" %>
<%= ", " unless index == Array(rule.weight_classes).size - 1 %>
<% end %>
</td>
<!-- Display bracket positions and rounds -->
<td><%= rule.bracket_positions.join(", ") %></td>
<td><%= rule.rounds.join(", ") %></td>
<!-- Edit and Delete Actions -->
<td><%= Array(rule.bracket_positions).join(", ") %></td>
<td><%= Array(rule.rounds).join(", ") %></td>
<td>
<%= link_to '', edit_tournament_mat_assignment_rule_path(@tournament, rule), :class=>"fas fa-edit" %>
<%= link_to '', tournament_mat_assignment_rule_path(@tournament, rule), method: :delete, data: { confirm: "Are you sure?" }, :class=>"fas fa-trash-alt" %>
<%= link_to '', edit_tournament_mat_assignment_rule_path(@tournament, rule), class: "fas fa-edit" %>
<%= link_to '', tournament_mat_assignment_rule_path(@tournament, rule), method: :delete, data: { confirm: "Are you sure?" }, class: "fas fa-trash-alt" %>
</td>
</tr>
<% end %>