diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2006-08-06 02:51:53 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2006-08-06 02:51:53 +0000 |
commit | cbc3afb8786a9e6caa486fa2c97b17348c9eff51 (patch) | |
tree | 949c86a1371ea2d3aff00af4398581c4cf6f00cd /railties/lib/initializer.rb | |
parent | 000a8ed9c688afe167f1d4cd4b6327d350272444 (diff) | |
download | rails-cbc3afb8786a9e6caa486fa2c97b17348c9eff51.tar.gz rails-cbc3afb8786a9e6caa486fa2c97b17348c9eff51.tar.bz2 rails-cbc3afb8786a9e6caa486fa2c97b17348c9eff51.zip |
Add Dispatcher.to_prepare and config.to_prepare to provide a pre-request hook.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4686 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/initializer.rb')
-rw-r--r-- | railties/lib/initializer.rb | 7 |
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 |