mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-01 12:15: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:
@@ -82,11 +82,11 @@ class WeightsController < ApplicationController
|
||||
end
|
||||
def check_access
|
||||
if params[:tournament]
|
||||
@tournament = Tournament.where(:id => params[:tournament]).includes(:delegates,:user).first
|
||||
@tournament = Tournament.find(params[:tournament])
|
||||
elsif params[:weight]
|
||||
@tournament = Tournament.where(:id => params[:weight]["tournament_id"]).includes(:delegates,:user).first
|
||||
@tournament = Tournament.find(params[:weight]["tournament_id"])
|
||||
elsif @weight
|
||||
@tournament = Tournament.where(:id => @weight.tournament.id).includes(:delegates,:user).first
|
||||
@tournament = @weight.tournament
|
||||
end
|
||||
authorize! :manage, @tournament
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user