aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-08-12 21:08:45 -0300
committerGitHub <noreply@github.com>2016-08-12 21:08:45 -0300
commitafdc2bcc4360197d31ca1d0dc08c14741ce9ca8e (patch)
treefc2e16341d7098a8ef8a4d69b099f363e7481aa7
parentb2ab8b77de7500c6da763f4707f5b77ecade81fb (diff)
parent3bbd2d4dff4babd1b4babdb47429630024cb1b00 (diff)
downloadrails-afdc2bcc4360197d31ca1d0dc08c14741ce9ca8e.tar.gz
rails-afdc2bcc4360197d31ca1d0dc08c14741ce9ca8e.tar.bz2
rails-afdc2bcc4360197d31ca1d0dc08c14741ce9ca8e.zip
Merge pull request #25856 from mrageh/improve-lazy-load-hook-docs
Add documentation about `ActiveSupport.on_load`
-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)