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

Fixed a couple slow queries

This commit is contained in:
2021-12-11 03:08:43 +00:00
parent 5ef27f19cc
commit 8430949a37
6 changed files with 15 additions and 10 deletions

View File

@@ -15,6 +15,10 @@ class ApiController < ApplicationController
def tournament
@tournament = Tournament.where(:id => params[:tournament]).includes(:schools,:weights,:mats,:matches,:user,:wrestlers).first
@schools = @tournament.schools.includes(:wrestlers)
@weights = @tournament.weights.includes(:wrestlers)
@matches = @tournament.matches.includes(:wrestlers,:schools)
@mats = @tournament.mats.includes(:matches)
end
def newTournament