Beef up Rails::Railtie::Configuration docs

This commit is contained in:
Gabriel Horner 2011-03-19 19:53:36 -04:00
parent f3666040a0
commit 6c309f04c9
1 changed files with 8 additions and 0 deletions

View File

@ -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