Skip to content

Commit 607d61e

Browse files
authored
Merge pull request rails#52634 from Shopify/uk-fix-method-added
Call `super` from `method_added`/`singleton_method_added` methods
2 parents 16882b8 + 73b6000 commit 607d61e

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

activerecord/lib/active_record/scoping/named.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def scope(name, body, &block)
190190

191191
private
192192
def singleton_method_added(name)
193+
super
193194
# Most Kernel extends are both singleton and instance methods so
194195
# respond_to is a fast check, but we don't want to define methods
195196
# only on the module (ex. Module#name)

activesupport/lib/active_support/current_attributes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ def respond_to_missing?(name, _)
182182
end
183183

184184
def method_added(name)
185+
super
185186
return if name == :initialize
186187
return unless public_method_defined?(name)
187188
return if respond_to?(name, true)

activesupport/lib/active_support/subscriber.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def detach_from(namespace, notifier = ActiveSupport::Notifications)
6767

6868
# Adds event subscribers for all new methods added to the class.
6969
def method_added(event)
70+
super
7071
# Only public methods are added as subscribers, and only if a notifier
7172
# has been set up. This means that subscribers will only be set up for
7273
# classes that call #attach_to.

0 commit comments

Comments
 (0)