Skip to content

Commit

Permalink
Rack mini profiler for dev env
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaporozhets committed Aug 2, 2012
1 parent 9bf7c1e commit 7dd2768
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Expand Up @@ -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)
Expand Down Expand Up @@ -408,6 +410,7 @@ DEPENDENCIES
omniauth-ldap!
pry
pygments.rb!
rack-mini-profiler
rails (= 3.2.5)
rails-footnotes
raphael-rails (= 1.5.2)
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/application_controller.rb
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit 7dd2768

Please sign in to comment.