1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-06 14:36:59 +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

@@ -91,16 +91,16 @@ class WrestlersController < ApplicationController
end
def check_access
if params[:school]
@school = School.where(:id => params[:school]).includes(:delegates,:tournament).first
@school = School.find(params[:school])
#@tournament = Tournament.find(@school.tournament.id)
elsif params[:wrestler]
@school = School.where(:id => params[:wrestler]["school_id"]).includes(:delegates,:tournament).first
@school = School.find(params[:wrestler]["school_id"])
#@tournament = Tournament.find(@school.tournament.id)
elsif @wrestler
@school = School.where(:id => @wrestler.school.tournament.id).includes(:delegates,:tournament).first
@school = @wrestler.school
#@tournament = @wrestler.tournament
elsif wrestler_params
@school = School.where(:id => wrestler_params[:school_id]).includes(:delegates,:tournament).first
@school = School.find(wrestler_params[:school_id])
end
authorize! :manage, @school
end