Merge pull request #622 from sgmap/rack_mini_profiler

Add rack_mini_profiler
This commit is contained in:
LeSim 2017-07-25 14:40:44 +02:00 committed by GitHub
commit 56a9376a60
3 changed files with 12 additions and 0 deletions

View file

@ -109,6 +109,8 @@ gem 'prawn_rails', '~> 0.0.11'
gem 'chunky_png'
gem 'sentry-raven'
gem 'rack-mini-profiler'
group :test do
gem 'capybara'
gem 'launchy'

View file

@ -448,6 +448,8 @@ GEM
rack (2.0.1)
rack-handlers (0.7.3)
rack
rack-mini-profiler (0.10.5)
rack (>= 1.2.0)
rack-oauth2 (1.4.0)
activesupport (>= 2.3)
attr_required (>= 0.0.5)
@ -725,6 +727,7 @@ DEPENDENCIES
prawn_rails (~> 0.0.11)
pry-byebug
rack-handlers
rack-mini-profiler
rails (= 5.0.0.1)
rails-controller-testing
redis

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?