Always show rack-mini-profiler in development
This commit is contained in:
parent
5f342ae0ee
commit
6aff39dfed
1 changed files with 2 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue