diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-12-01 14:53:31 -0500 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-12-01 14:53:31 -0500 |
commit | 4e73ffa9b45904492815f8f67d4695ef719e0350 (patch) | |
tree | 132461bb09747fd5a66fd40316578713a04c249c /activesupport/lib/active_support/core_ext | |
parent | 22042331650e943a1bb3f954fef7e2951e3ad2a3 (diff) | |
download | rails-4e73ffa9b45904492815f8f67d4695ef719e0350.tar.gz rails-4e73ffa9b45904492815f8f67d4695ef719e0350.tar.bz2 rails-4e73ffa9b45904492815f8f67d4695ef719e0350.zip |
Exclude singleton classes from `subclasses` and `descendants`
This behavior changed in Ruby starting with 2.3.0, as a result of
https://bugs.ruby-lang.org/issues/11360. This results in a change in
behavior of these methods which is likely undesirable.
Fixes #27238
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/subclasses.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/subclasses.rb b/activesupport/lib/active_support/core_ext/class/subclasses.rb index 10a7c787f6..62397d9508 100644 --- a/activesupport/lib/active_support/core_ext/class/subclasses.rb +++ b/activesupport/lib/active_support/core_ext/class/subclasses.rb @@ -22,6 +22,7 @@ class Class def descendants descendants = [] ObjectSpace.each_object(singleton_class) do |k| + next if k.singleton_class? descendants.unshift k unless k == self end descendants |