aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorSergey Nartimov <just.lest@gmail.com>2012-01-04 21:51:39 +0300
committerSergey Nartimov <just.lest@gmail.com>2012-01-04 21:51:39 +0300
commitce2c4c977cf5437c35f3611ad48fb4682c1269ec (patch)
treee28353afad2da07cbc6c9f2069370061daa35690 /activesupport/lib
parent34551bf31e859c4d9aeaeae2b68bf2c338558b74 (diff)
downloadrails-ce2c4c977cf5437c35f3611ad48fb4682c1269ec.tar.gz
rails-ce2c4c977cf5437c35f3611ad48fb4682c1269ec.tar.bz2
rails-ce2c4c977cf5437c35f3611ad48fb4682c1269ec.zip
simplify Class#descendants using singleton_class method
Diffstat (limited to 'activesupport/lib')
-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