We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 76aa442 commit ede2236Copy full SHA for ede2236
lib/appmap/hook/method.rb
@@ -125,8 +125,12 @@ def activate
125
hook_method_parameters = hook_method.parameters.dup.freeze
126
SIGNATURES[[ hook_class, hook_method.name ]] = hook_method_parameters
127
128
- hook_class.ancestors.first.tap do |cls|
129
- cls.define_method_with_arity(hook_method.name, hook_method.arity, hook_method_def)
+ hook_class.ancestors.find { |cls| cls.method_defined?(hook_method.name, false) }.tap do |cls|
+ if cls
130
+ cls.define_method_with_arity(hook_method.name, hook_method.arity, hook_method_def)
131
+ else
132
+ warn "#{hook_method.name} not found on #{hook_class}"
133
+ end
134
end
135
136
0 commit comments