From 4aded43b73ff94dbf06b4a2d2075651ce454e1d5 Mon Sep 17 00:00:00 2001 From: wycats Date: Mon, 29 Mar 2010 17:08:08 -0700 Subject: Replace the placeholder base_hook API with on_load. To specify some code that should run during framework load do: ActiveSupport.on_load(:action_controller) do # Code run in the context of AC::Base end --- actionpack/lib/action_controller/railtie.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/action_controller/railtie.rb') diff --git a/actionpack/lib/action_controller/railtie.rb b/actionpack/lib/action_controller/railtie.rb index 0ec89928af..29d8523ee1 100644 --- a/actionpack/lib/action_controller/railtie.rb +++ b/actionpack/lib/action_controller/railtie.rb @@ -41,7 +41,7 @@ module ActionController log_subscriber :action_controller, ActionController::Railties::LogSubscriber.new initializer "action_controller.logger" do - ActionController.base_hook { self.logger ||= Rails.logger } + ActiveSupport.on_load(:action_controller) { self.logger ||= Rails.logger } end initializer "action_controller.set_configs" do |app| @@ -53,23 +53,23 @@ module ActionController ac.stylesheets_dir = paths.public.stylesheets.to_a.first ac.secret = app.config.cookie_secret - ActionController.base_hook do + ActiveSupport.on_load(:action_controller) do self.config.merge!(ac) end end initializer "action_controller.initialize_framework_caches" do - ActionController.base_hook { self.cache_store ||= RAILS_CACHE } + ActiveSupport.on_load(:action_controller) { self.cache_store ||= RAILS_CACHE } end initializer "action_controller.set_helpers_path" do |app| - ActionController.base_hook do + ActiveSupport.on_load(:action_controller) do self.helpers_path = app.config.paths.app.helpers.to_a end end initializer "action_controller.url_helpers" do |app| - ActionController.base_hook do + ActiveSupport.on_load(:action_controller) do extend ::ActionController::Railties::UrlHelpers.with(app.routes) end -- cgit v1.2.3