Permalink
Browse files

Include the ControllerHelpers directly into `ActionController::Base`.

Including on `ApplicationController` won't affect controllers inside
engines, and breaks such controllers when used with `peek-rblineprof`
as it extends `AC::Base` directly.
  • Loading branch information...
1 parent d0b4004 commit 5f0ea865d37ddc192381a0fc03dc61e608aff373 @lucasmazza lucasmazza committed Dec 3, 2013
Showing with 5 additions and 12 deletions.
  1. +0 −10 README.md
  2. +1 −1 lib/peek.rb
  3. +4 −1 lib/peek/railtie.rb
View
10 README.md
@@ -151,16 +151,6 @@ It just works.
It just works.
-## Using Peek with Spork
-
-For best results with Spork, add this to your `prefork` block
-anytime before your environment is loaded:
-
-```ruby
-require 'peek'
-Spork.trap_class_method(Peek, :setup)
-```
-
## Access Control
Peek will only render in development and staging environments. If you'd
View
2 lib/peek.rb
@@ -103,7 +103,7 @@ def self.clear
end
def self.setup
- ApplicationController.send(:include, Peek::ControllerHelpers)
+ ActiveSupport::Deprecation.warn "'Peek.setup' is deprecated and does nothing.", caller
end
end
View
5 lib/peek/railtie.rb
@@ -26,8 +26,11 @@ class Railtie < ::Rails::Engine
end
initializer 'peek.include_controller_helpers' do
+ ActiveSupport.on_load(:action_controller) do
+ include Peek::ControllerHelpers
+ end
+
config.to_prepare do
- Peek.setup
Peek.views
end
end

0 comments on commit 5f0ea86

Please sign in to comment.