From 3bbd2d4dff4babd1b4babdb47429630024cb1b00 Mon Sep 17 00:00:00 2001 From: mrageh Date: Sat, 16 Jul 2016 15:52:25 +0100 Subject: Add documentation about `ActiveSupport.on_load` [ci skip] This commit adds some docs that explain how `LazyLoadHooks.on_load` method works. --- activesupport/lib/active_support/lazy_load_hooks.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activesupport/lib/active_support/lazy_load_hooks.rb') 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) -- cgit v1.2.3