From ce2c4c977cf5437c35f3611ad48fb4682c1269ec Mon Sep 17 00:00:00 2001 From: Sergey Nartimov Date: Wed, 4 Jan 2012 21:51:39 +0300 Subject: [PATCH] simplify Class#descendants using singleton_class method --- activesupport/lib/active_support/core_ext/class/subclasses.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/core_ext/class/subclasses.rb b/activesupport/lib/active_support/core_ext/class/subclasses.rb index 46e9daaa8f..74ea047c24 100644 --- a/activesupport/lib/active_support/core_ext/class/subclasses.rb +++ b/activesupport/lib/active_support/core_ext/class/subclasses.rb @@ -7,7 +7,7 @@ class Class #:nodoc: def descendants descendants = [] - ObjectSpace.each_object(class << self; self; end) do |k| + ObjectSpace.each_object(singleton_class) do |k| descendants.unshift k unless k == self end descendants