1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

5 commits

Author SHA1 Message Date
José Valim
3afdfc35e8 Expose remaining hooks to minimize the need for a Railtie based on feedback from plugin developers. 2010-05-16 00:36:46 +02:00
wycats
9cfeefb637 Reorganized initializers a bit to enable better hooks for common cases without the need for Railtie. Specifically, the following hooks were added:
* before_configuration: this hook is run immediately after the Application class 
  comes into existence, but before the user has added any configuration. This is
  the appropriate place to set configuration for your plugin
* before_initialize: This is run after all of the user's configuration has completed,
  but before any initializers have begun (in other words, it runs right after
  config/environments/{development,production,test}.rb)
* after_initialize: This is run after all of the initializers have run. It is an
  appropriate place for forking in a preforking setup

Each of these hooks may be used via ActiveSupport.on_load(name) { }. In all these cases, the context inside the block will be the Application object. This means that for simple cases, you can use these hooks without needing to create a Railtie.
2010-05-15 06:09:07 -07:00
José Valim
e49f94d71c Revert behavior from a5684dfa3c and ensure after_initializer is executed after to_prepare callbacks. 2010-02-19 08:15:49 +01:00
José Valim
a5684dfa3c Ensure config.after_initializer is executed before building the middleware stack. 2010-02-18 18:56:11 +01:00
José Valim
1dca7ebc93 Refactor railties test, break huge files in smaller chunks and move initializers to application folder. 2010-01-26 13:57:11 +01:00