Enable rack mini profiler when super admin is connected

This commit is contained in:
Mathieu Magnin 2017-07-24 12:29:09 +02:00 committed by Simon Lehericey
parent 0a1edce5e0
commit d097860b04

View file

@ -5,6 +5,13 @@ class ApplicationController < ActionController::Base
before_action :check_browser
before_action :load_navbar_left_pannel_partial_url
before_action :set_raven_context
before_action :authorize_request_for_profiler
def authorize_request_for_profiler
if Rails.env.production? && administration_signed_in?
Rack::MiniProfiler.authorize_request
end
end
def default_url_options
return {protocol: 'https'} if Rails.env.staging? || Rails.env.production?