From ae59cb2b21969a112208fe68dbf42052ac6032b9 Mon Sep 17 00:00:00 2001 From: jcwimer Date: Thu, 14 Jan 2016 19:38:51 +0000 Subject: [PATCH] Trying to eager load in a few places --- app/controllers/schools_controller.rb | 2 +- app/controllers/tournaments_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/schools_controller.rb b/app/controllers/schools_controller.rb index 54697a3..dce74bc 100644 --- a/app/controllers/schools_controller.rb +++ b/app/controllers/schools_controller.rb @@ -69,7 +69,7 @@ class SchoolsController < ApplicationController private # Use callbacks to share common setup or constraints between actions. 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 # Never trust parameters from the scary internet, only allow the white list through. diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index bcdc67c..d78b831 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -181,7 +181,7 @@ class TournamentsController < ApplicationController end def show - @schools = @tournament.schools + @schools = @tournament.schools(:delegates) @weights = @tournament.weights.sort_by{|x|[x.max]} @mats = @tournament.mats end