Permalink
Browse files

simplify Class#descendants using singleton_class method

  • Loading branch information...
1 parent 34551bf commit ce2c4c977cf5437c35f3611ad48fb4682c1269ec @lest lest committed Jan 4, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/core_ext/class/subclasses.rb
View
2 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

0 comments on commit ce2c4c9

Please sign in to comment.