Skip to content

Commit b205dc4

Browse files
committed
DescendantsTracker: fix a method redefinition warning
1 parent 837f20e commit b205dc4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

activesupport/lib/active_support/descendants_tracker.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ def reject!(classes) # :nodoc:
9595
end
9696
end
9797

98-
def descendants
99-
subclasses = self.subclasses
100-
subclasses.concat(subclasses.flat_map(&:descendants))
101-
end
102-
10398
if RubyFeatures::CLASS_SUBCLASSES
10499
class << self
105100
def subclasses(klass)
@@ -110,6 +105,11 @@ def descendants(klass)
110105
klass.descendants
111106
end
112107
end
108+
109+
def descendants
110+
subclasses = self.subclasses
111+
subclasses.concat(subclasses.flat_map(&:descendants))
112+
end
113113
else
114114
# DescendantsArray is an array that contains weak references to classes.
115115
# Note: DescendantsArray is redundant with WeakSet, however WeakSet when used

0 commit comments

Comments
 (0)