Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

simplify Class#descendants using singleton_class method #4302

Merged
merged 1 commit into from

2 participants

@lest

No description provided.

@fxn fxn merged commit 33386b0 into rails:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 4, 2012
  1. @lest
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.