instance method run_load_hooks

Ruby on Rails 8.0.4

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

run_load_hooks(name, base = Object)

Executes all blocks registered to name via on_load, using base as the evaluation context.

ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base)

In the case of the above example, it will execute all hooks registered for :active_record within the class ActiveRecord::Base.

Parameters

name req
base opt = Object
Source
# File activesupport/lib/active_support/lazy_load_hooks.rb, line 75
    def run_load_hooks(name, base = Object)
      @loaded[name] << base
      @load_hooks[name].each do |hook, options|
        execute_hook(name, base, options, hook)
      end
    end

Defined in activesupport/lib/active_support/lazy_load_hooks.rb line 75 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::LazyLoadHooks

Type at least 2 characters to search.

↑↓ navigate · open · esc close