You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
moduleSomeModuleextendActiveSupport::ConcernincludeddoincludeHooksdefine_hooks:myhook1endendclassMyClassincludeHooksdefine_hooks:myhook2includeSomeModuledefrun_myhook1run_hook:myhook1enddefrun_myhook2run_hook:myhook2endendMyClass._hooks# => {:myhook1=>[]}MyClass.new.run_myhook1# => Works fineMyClass.new.run_myhook2# => NoMethodError: undefined method `run' for nil:NilClass
This seems to be because the following code in lib/hooks.rb runs on every include:
# lib/hooks.rbmoduleHooksdefself.included(base)base.class_evaldoextendUber::InheritableAttrextendClassMethodsinheritable_attr:_hooksself._hooks=HookSet.new# <-- this wipes out existing hooksendend
The text was updated successfully, but these errors were encountered:
This seems to be because the following code in
lib/hooks.rb
runs on everyinclude
:The text was updated successfully, but these errors were encountered: