diff options
author | wycats <wycats@gmail.com> | 2010-03-29 17:08:08 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-03-29 17:08:50 -0700 |
commit | 4aded43b73ff94dbf06b4a2d2075651ce454e1d5 (patch) | |
tree | 6bac5b0c25e5186b6e92c04fb6e19550630bbe8a /actionpack/lib/action_controller/railtie.rb | |
parent | 331327d3919a633679dd3f434d13173fa8df010f (diff) | |
download | rails-4aded43b73ff94dbf06b4a2d2075651ce454e1d5.tar.gz rails-4aded43b73ff94dbf06b4a2d2075651ce454e1d5.tar.bz2 rails-4aded43b73ff94dbf06b4a2d2075651ce454e1d5.zip |
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
Diffstat (limited to 'actionpack/lib/action_controller/railtie.rb')
-rw-r--r-- | actionpack/lib/action_controller/railtie.rb | 10 |
1 files changed, 5 insertions, 5 deletions
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 |