aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/application/routes_reloader.rb2
-rw-r--r--railties/lib/rails/engine.rb9
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|