diff options
author | Gabriel Horner <gabriel.horner@gmail.com> | 2011-03-19 19:53:36 -0400 |
---|---|---|
committer | Gabriel Horner <gabriel.horner@gmail.com> | 2011-03-19 19:53:36 -0400 |
commit | 6c309f04c9e2538cc61d6a1c753da3c6cc91b51f (patch) | |
tree | 52523a994437c54e06cd3042846acc25fd7b93db /railties | |
parent | f3666040a0a883ab75dd53012cc4ace66f90606b (diff) | |
download | rails-6c309f04c9e2538cc61d6a1c753da3c6cc91b51f.tar.gz rails-6c309f04c9e2538cc61d6a1c753da3c6cc91b51f.tar.bz2 rails-6c309f04c9e2538cc61d6a1c753da3c6cc91b51f.zip |
Beef up Rails::Railtie::Configuration docs
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/railtie/configuration.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/lib/rails/railtie/configuration.rb b/railties/lib/rails/railtie/configuration.rb index e4368866a1..2c7b5bc048 100644 --- a/railties/lib/rails/railtie/configuration.rb +++ b/railties/lib/rails/railtie/configuration.rb @@ -31,26 +31,34 @@ module Rails app_generators(&block) end + # First configurable block to run. Called before any initializers are run. def before_configuration(&block) ActiveSupport.on_load(:before_configuration, :yield => true, &block) end + # Third configurable block to run. Does not run if config.cache_classes + # set to false. def before_eager_load(&block) ActiveSupport.on_load(:before_eager_load, :yield => true, &block) end + # Second configurable block to run. Called before frameworks initialize. def before_initialize(&block) ActiveSupport.on_load(:before_initialize, :yield => true, &block) end + # Last configurable block to run. Called after frameworks initialize. def after_initialize(&block) ActiveSupport.on_load(:after_initialize, :yield => true, &block) end + # Array of callbacks defined by #to_prepare. def to_prepare_blocks @@to_prepare_blocks ||= [] end + # Defines generic callbacks to run before #after_initialize. Useful for + # Rails::Railtie subclasses. def to_prepare(&blk) to_prepare_blocks << blk if blk end |