Skip to content

Commit

Permalink
Modify Reflection.resolve_loc to be aware of ActiveSupport.on_load …
Browse files Browse the repository at this point in the history
…hooks

We are mistakenly attributing code that is loaded by ActiveSupport.on_load
to Rails, rather than whatever gem performs the hook.
  • Loading branch information
egiurleo committed Oct 17, 2024
1 parent af948ff commit dcc0f83
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/tapioca/runtime/reflection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ module Reflection
METHOD_METHOD = T.let(Kernel.instance_method(:method), UnboundMethod)
UNDEFINED_CONSTANT = T.let(Module.new.freeze, Module)

REQUIRED_FROM_LABELS = T.let(["<top (required)>", "<main>"].freeze, T::Array[String])
REQUIRED_FROM_LABELS = T.let(
["block in <class:ActiveRecord>", "<top (required)>", "<main>"].freeze,
T::Array[String],
)

T::Sig::WithoutRuntime.sig { params(constant: BasicObject).returns(T::Boolean) }
def constant_defined?(constant)
Expand Down

0 comments on commit dcc0f83

Please sign in to comment.