Commit 7dd276817c6459e0fdf6524f1b8e51decd385986

Authored by randx
1 parent 9bf7c1ee

Rack mini profiler for dev env

Gemfile
... ... @@ -60,6 +60,7 @@ group :development do
60 60 gem "letter_opener"
61 61 gem "rails-footnotes"
62 62 gem "annotate", :git => "https://github.com/ctran/annotate_models.git"
  63 + gem 'rack-mini-profiler'
63 64 end
64 65  
65 66 group :development, :test do
... ...
Gemfile.lock
... ... @@ -237,6 +237,8 @@ GEM
237 237 rack (1.4.1)
238 238 rack-cache (1.2)
239 239 rack (>= 0.4)
  240 + rack-mini-profiler (0.1.9)
  241 + rack (>= 1.1.3)
240 242 rack-mount (0.8.3)
241 243 rack (>= 1.0.0)
242 244 rack-protection (1.2.0)
... ... @@ -408,6 +410,7 @@ DEPENDENCIES
408 410 omniauth-ldap!
409 411 pry
410 412 pygments.rb!
  413 + rack-mini-profiler
411 414 rails (= 3.2.5)
412 415 rails-footnotes
413 416 raphael-rails (= 1.5.2)
... ...
app/controllers/application_controller.rb
... ... @@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base
4 4 before_filter :set_current_user_for_mailer
5 5 before_filter :check_token_auth
6 6 before_filter :set_current_user_for_observers
  7 + before_filter :dev_tools if Rails.env == 'development'
7 8  
8 9 protect_from_forgery
9 10  
... ... @@ -142,4 +143,8 @@ class ApplicationController < ActionController::Base
142 143 def render_full_content
143 144 @full_content = true
144 145 end
  146 +
  147 + def dev_tools
  148 + Rack::MiniProfiler.authorize_request
  149 + end
145 150 end
... ...