Skip to content

Commit

Permalink
Add documentation about ActiveSupport.on_load
Browse files Browse the repository at this point in the history
[ci skip]

This commit adds some docs that explain how `LazyLoadHooks.on_load` method
works.
  • Loading branch information
mrageh committed Aug 13, 2016
1 parent b2ab8b7 commit 3bbd2d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions activesupport/lib/active_support/lazy_load_hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def self.extended(base) # :nodoc:
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)
Expand Down

0 comments on commit 3bbd2d4

Please sign in to comment.