mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #4302 from lest/simplify-descendants
simplify Class#descendants using singleton_class method
This commit is contained in:
commit
33386b065c
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ class Class #:nodoc:
|
||||||
|
|
||||||
def descendants
|
def descendants
|
||||||
descendants = []
|
descendants = []
|
||||||
ObjectSpace.each_object(class << self; self; end) do |k|
|
ObjectSpace.each_object(singleton_class) do |k|
|
||||||
descendants.unshift k unless k == self
|
descendants.unshift k unless k == self
|
||||||
end
|
end
|
||||||
descendants
|
descendants
|
||||||
|
|
Loading…
Reference in a new issue