Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

@lucasmazza

Including on ApplicationController won't affect controllers inside engines,
and breaks such controllers when used with peek-rblineprof as it extends
AC::Base directly.

This also makes the Spork specific setup and the Peek.setup API unnecessary.

@lucasmazza lucasmazza 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.
5f0ea86
@dewski dewski merged commit 8ff398b into peek:master
@dewski
Owner

Thanks for the PR! Released v0.1.8 on Rubygems.

@lucasmazza lucasmazza deleted the unknown repository branch
@lucasmazza

@dewski thanks a lot for the release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 3, 2013
  1. @lucasmazza

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

    lucasmazza authored
    Including on `ApplicationController` won't affect controllers inside
    engines, and breaks such controllers when used with `peek-rblineprof`
    as it extends `AC::Base` directly.
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.