1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-12 16:25:41 +00:00

Trying to eager load in a few places

This commit is contained in:
2016-01-14 19:38:51 +00:00
parent dbd276e818
commit ae59cb2b21
2 changed files with 2 additions and 2 deletions

View File

@@ -69,7 +69,7 @@ class SchoolsController < ApplicationController
private private
# Use callbacks to share common setup or constraints between actions. # Use callbacks to share common setup or constraints between actions.
def set_school def set_school
@school = School.where(:id => params[:id]).includes(:tournament,:wrestlers).first @school = School.where(:id => params[:id]).includes(:tournament,:wrestlers,:deductedPoints).first
end end
# Never trust parameters from the scary internet, only allow the white list through. # Never trust parameters from the scary internet, only allow the white list through.

View File

@@ -181,7 +181,7 @@ class TournamentsController < ApplicationController
end end
def show def show
@schools = @tournament.schools @schools = @tournament.schools(:delegates)
@weights = @tournament.weights.sort_by{|x|[x.max]} @weights = @tournament.weights.sort_by{|x|[x.max]}
@mats = @tournament.mats @mats = @tournament.mats
end end