1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-01 03:55:44 +00:00

Refactored match winner and wrestlers matches and fixed slow tests.

This commit is contained in:
2025-04-25 15:59:35 -04:00
parent 3e4317dbc5
commit 1fcaec876f
20 changed files with 147 additions and 116 deletions

View File

@@ -98,7 +98,8 @@ class WeightsController < ApplicationController
private
# Use callbacks to share common setup or constraints between actions.
def set_weight
@weight = Weight.where(:id => params[:id]).includes(:tournament,:wrestlers).first
# Add nested includes for wrestlers
@weight = Weight.includes(:tournament, wrestlers: [:school, :matches_as_w1, :matches_as_w2]).find_by(id: params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.