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 /railties/lib/rails | |
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 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/application/routes_reloader.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/engine.rb | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb index a5154f4bba..a2b3622df8 100644 --- a/railties/lib/rails/application/routes_reloader.rb +++ b/railties/lib/rails/application/routes_reloader.rb @@ -27,7 +27,7 @@ module Rails routes.clear! paths.each { |path| load(path) } - ActionController.base_hook { routes.finalize! } + ActiveSupport.on_load(:action_controller) { routes.finalize! } nil ensure diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 85cae75bce..e9013348b5 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -180,8 +180,13 @@ module Rails initializer :add_view_paths do views = paths.app.views.to_a - ActionController.base_hook { prepend_view_path(views) } if defined?(ActionController) - ActionMailer.base_hook { prepend_view_path(views) } if defined?(ActionMailer) + ActiveSupport.on_load(:action_controller) do + prepend_view_path(views) + end + + ActiveSupport.on_load(:action_mailer) do + prepend_view_path(views) + end end initializer :add_metals do |app| |