My initializer code.
Myapp::Application.config.after_initialize do
LoggedExceptionsController.class_eval do
load_and_authorize_resource
end
end
When logged in as an unauthorized user I get redirected correctly once when the app is restarted but after that I am able to access the logged_exceptions page. I've tried moving this code to application.rb and development.rb (without Myapp::Application) with no success. No matter what I do I can't get the authorization to work more than once when the app is restarted. Any ideas?