aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/lazy_load_hooks.rb
diff options
context:
space:
mode:
authormrageh <adam@mrageh.com>2016-07-16 15:52:25 +0100
committermrageh <adam@mrageh.com>2016-08-13 01:01:21 +0100
commit3bbd2d4dff4babd1b4babdb47429630024cb1b00 (patch)
treefc2e16341d7098a8ef8a4d69b099f363e7481aa7 /activesupport/lib/active_support/lazy_load_hooks.rb
parentb2ab8b77de7500c6da763f4707f5b77ecade81fb (diff)
downloadrails-3bbd2d4dff4babd1b4babdb47429630024cb1b00.tar.gz
rails-3bbd2d4dff4babd1b4babdb47429630024cb1b00.tar.bz2
rails-3bbd2d4dff4babd1b4babdb47429630024cb1b00.zip
Add documentation about `ActiveSupport.on_load`
[ci skip] This commit adds some docs that explain how `LazyLoadHooks.on_load` method works.
Diffstat (limited to 'activesupport/lib/active_support/lazy_load_hooks.rb')
-rw-r--r--activesupport/lib/active_support/lazy_load_hooks.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/lazy_load_hooks.rb b/activesupport/lib/active_support/lazy_load_hooks.rb
index 67b54b45ea..b84c7253a0 100644
--- a/activesupport/lib/active_support/lazy_load_hooks.rb
+++ b/activesupport/lib/active_support/lazy_load_hooks.rb
@@ -28,6 +28,8 @@ module ActiveSupport
end
end
+ # Declares a block that will be executed when a Rails component is fully
+ # loaded.
def on_load(name, options = {}, &block)
@loaded[name].each do |base|
execute_hook(base, options, block)