Merge pull request #622 from sgmap/rack_mini_profiler
Add rack_mini_profiler
This commit is contained in:
commit
56a9376a60
3 changed files with 12 additions and 0 deletions
2
Gemfile
2
Gemfile
|
@ -109,6 +109,8 @@ gem 'prawn_rails', '~> 0.0.11'
|
||||||
gem 'chunky_png'
|
gem 'chunky_png'
|
||||||
gem 'sentry-raven'
|
gem 'sentry-raven'
|
||||||
|
|
||||||
|
gem 'rack-mini-profiler'
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem 'capybara'
|
gem 'capybara'
|
||||||
gem 'launchy'
|
gem 'launchy'
|
||||||
|
|
|
@ -448,6 +448,8 @@ GEM
|
||||||
rack (2.0.1)
|
rack (2.0.1)
|
||||||
rack-handlers (0.7.3)
|
rack-handlers (0.7.3)
|
||||||
rack
|
rack
|
||||||
|
rack-mini-profiler (0.10.5)
|
||||||
|
rack (>= 1.2.0)
|
||||||
rack-oauth2 (1.4.0)
|
rack-oauth2 (1.4.0)
|
||||||
activesupport (>= 2.3)
|
activesupport (>= 2.3)
|
||||||
attr_required (>= 0.0.5)
|
attr_required (>= 0.0.5)
|
||||||
|
@ -725,6 +727,7 @@ DEPENDENCIES
|
||||||
prawn_rails (~> 0.0.11)
|
prawn_rails (~> 0.0.11)
|
||||||
pry-byebug
|
pry-byebug
|
||||||
rack-handlers
|
rack-handlers
|
||||||
|
rack-mini-profiler
|
||||||
rails (= 5.0.0.1)
|
rails (= 5.0.0.1)
|
||||||
rails-controller-testing
|
rails-controller-testing
|
||||||
redis
|
redis
|
||||||
|
|
|
@ -5,6 +5,13 @@ class ApplicationController < ActionController::Base
|
||||||
before_action :check_browser
|
before_action :check_browser
|
||||||
before_action :load_navbar_left_pannel_partial_url
|
before_action :load_navbar_left_pannel_partial_url
|
||||||
before_action :set_raven_context
|
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
|
def default_url_options
|
||||||
return {protocol: 'https'} if Rails.env.staging? || Rails.env.production?
|
return {protocol: 'https'} if Rails.env.staging? || Rails.env.production?
|
||||||
|
|
Loading…
Reference in a new issue