mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +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:
@@ -82,12 +82,12 @@ class MatsController < ApplicationController
|
||||
|
||||
def check_access
|
||||
if params[:tournament]
|
||||
@tournament = Tournament.where(:id => params[:tournament]).includes(:delegates,:user).first
|
||||
@tournament = Tournament.find(params[:tournament])
|
||||
elsif params[:mat]
|
||||
@mat = Mat.new(mat_params)
|
||||
@tournament = Tournament.where(:id => @mat.tournament_id).includes(:delegates,:user).first
|
||||
@tournament = Tournament.find(@mat.tournament_id)
|
||||
elsif @mat
|
||||
@tournament = Tournament.where(:id => @mat.tournament.id).includes(:delegates,:user).first
|
||||
@tournament = @mat.tournament
|
||||
end
|
||||
authorize! :manage, @tournament
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user