1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-02 21:24:25 +00:00

Revert "Eager load users and delegates for tournaments, eager load delegates and tournament for schools"

This reverts commit 911faceb7c.

Permissions to edit a wrestler are not working in production.
This commit is contained in:
2016-01-22 13:21:13 +00:00
parent 285cfa9647
commit e48d473807
6 changed files with 16 additions and 16 deletions

View File

@@ -79,13 +79,13 @@ class SchoolsController < ApplicationController
def check_access_director
if params[:tournament]
@tournament = Tournament.where(:id => params[:tournament]).includes(:delegates,:user).first
@tournament = Tournament.find(params[:tournament])
elsif params[:school]
@tournament = Tournament.where(:id => params[:school]["tournament_id"]).includes(:delegates,:user).first
@tournament = Tournament.find(params[:school]["tournament_id"])
elsif @school
@tournament = Tournament.where(:id => @school.tournament.id).includes(:delegates,:user).first
@tournament = @school.tournament
elsif school_params
@tournament = Tournament.where(:id => school_params[:tournament_id]).includes(:delegates,:user).first
@tournament = Tournament.find(school_params[:tournament_id])
end
authorize! :manage, @tournament
end