mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Refactored match winner and wrestlers matches and fixed slow tests.
This commit is contained in:
@@ -86,7 +86,11 @@ class WrestlersController < ApplicationController
|
||||
private
|
||||
|
||||
def set_wrestler
|
||||
@wrestler = Wrestler.includes(:school, :weight, :tournament, :matches).find_by(id: params[:id])
|
||||
@wrestler = Wrestler.includes(:school, :weight, :tournament, :matches_as_w1, :matches_as_w2).find_by(id: params[:id])
|
||||
|
||||
if @wrestler.nil?
|
||||
redirect_to root_path, alert: "Wrestler not found"
|
||||
end
|
||||
end
|
||||
|
||||
def wrestler_params
|
||||
|
||||
Reference in New Issue
Block a user