aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/initializer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/initializer.rb')
-rw-r--r--railties/lib/initializer.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index de58051f97..d18a5ecc4d 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -294,6 +294,13 @@ module Rails
configuration.after_initialize_block.call if configuration.after_initialize_block
end
+ # Add a preparation callback that will run before every request in development
+ # mode, or before the first request in production.
+ #
+ # See Dispatcher#to_prepare.
+ def to_prepare(&callback)
+ Dispatcher.to_prepare(&callback)
+ end
protected
# Return a list of plugin paths within base_path. A plugin path is