Always show rack-mini-profiler in development

This commit is contained in:
Emi Matchu 2026-01-17 22:15:13 -08:00
parent 5f342ae0ee
commit 6aff39dfed

View file

@ -12,11 +12,9 @@ class ApplicationController < ActionController::Base
before_action :save_return_to_path, before_action :save_return_to_path,
if: ->(c) { c.controller_name == 'sessions' && c.action_name == 'new' } if: ->(c) { c.controller_name == 'sessions' && c.action_name == 'new' }
# Enable profiling tools if logged in as admin. # Enable profiling tools in development or when logged in as an admin.
before_action do before_action do
if current_user && current_user.admin? Rack::MiniProfiler.authorize_request if Rails.env.development? || current_user&.admin?
Rack::MiniProfiler.authorize_request
end
end end
class AccessDenied < StandardError; end class AccessDenied < StandardError; end