From 7dd276817c6459e0fdf6524f1b8e51decd385986 Mon Sep 17 00:00:00 2001 From: randx Date: Thu, 2 Aug 2012 09:48:24 +0300 Subject: [PATCH] Rack mini profiler for dev env --- Gemfile | 1 + Gemfile.lock | 3 +++ app/controllers/application_controller.rb | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/Gemfile b/Gemfile index 8db7d813f8e5..f9eaa6f1e9ac 100644 --- a/Gemfile +++ b/Gemfile @@ -60,6 +60,7 @@ group :development do gem "letter_opener" gem "rails-footnotes" gem "annotate", :git => "https://github.com/ctran/annotate_models.git" + gem 'rack-mini-profiler' end group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index f3a93096e48b..ee8c8c8ca06b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -237,6 +237,8 @@ GEM rack (1.4.1) rack-cache (1.2) rack (>= 0.4) + rack-mini-profiler (0.1.9) + rack (>= 1.1.3) rack-mount (0.8.3) rack (>= 1.0.0) rack-protection (1.2.0) @@ -408,6 +410,7 @@ DEPENDENCIES omniauth-ldap! pry pygments.rb! + rack-mini-profiler rails (= 3.2.5) rails-footnotes raphael-rails (= 1.5.2) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3265046d2ae7..7ea9f320d667 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base before_filter :set_current_user_for_mailer before_filter :check_token_auth before_filter :set_current_user_for_observers + before_filter :dev_tools if Rails.env == 'development' protect_from_forgery @@ -142,4 +143,8 @@ def no_cache_headers def render_full_content @full_content = true end + + def dev_tools + Rack::MiniProfiler.authorize_request + end end