Permalink
Browse files

Merge pull request #41 from lucasmazza/lm-include-peek-on-ac-base

Include the ControllerHelpers directly into `ActionController::Base`.
  • Loading branch information...
2 parents d0b4004 + 5f0ea86 commit 8ff398b466c6d11f10e5a23888cbd9188b8fba7d @dewski dewski 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
@@ -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
@@ -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
@@ -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 8ff398b

Please sign in to comment.