aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2012-01-04 10:59:38 -0800
committerXavier Noria <fxn@hashref.com>2012-01-04 10:59:38 -0800
commit33386b065c8dc029f0c5f31188fdc4c12e1d7293 (patch)
treee28353afad2da07cbc6c9f2069370061daa35690 /activesupport/lib/active_support
parent34551bf31e859c4d9aeaeae2b68bf2c338558b74 (diff)
parentce2c4c977cf5437c35f3611ad48fb4682c1269ec (diff)
downloadrails-33386b065c8dc029f0c5f31188fdc4c12e1d7293.tar.gz
rails-33386b065c8dc029f0c5f31188fdc4c12e1d7293.tar.bz2
rails-33386b065c8dc029f0c5f31188fdc4c12e1d7293.zip
Merge pull request #4302 from lest/simplify-descendants
simplify Class#descendants using singleton_class method
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/class/subclasses.rb2
1 files changed, 1 insertions, 1 deletions
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