aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/lazy_load_hooks.rb
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace and example identationJosep M. Bach2010-08-151-7/+7
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-2/+2
| | | | 's/[ \t]*$//' -i {} \;)
* Adding documentation regarding lazy_load_hooksNeeraj Singh2010-07-291-1/+20
|
* Reorganized initializers a bit to enable better hooks for common cases ↵wycats2010-05-151-4/+14
| | | | | | | | | | | | | | | 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.
* Replace the placeholder base_hook API with on_load. To specify some code thatwycats2010-03-291-19/+11
| | | | | | | | should run during framework load do: ActiveSupport.on_load(:action_controller) do # Code run in the context of AC::Base end
* Make many parts of Rails lazy. In order to facilitate this,wycats2010-03-071-0/+25
add lazy_load_hooks.rb, which allows us to declare code that should be run at some later time. For instance, this allows us to defer requiring ActiveRecord::Base at boot time purely to apply configuration. Instead, we register a hook that should apply configuration once ActiveRecord::Base is loaded. With these changes, brings down total boot time of a new app to 300ms in production and 400ms in dev. TODO: rename base_hook