diff options
author | Sergey Nartimov <just.lest@gmail.com> | 2012-01-04 21:51:39 +0300 |
---|---|---|
committer | Sergey Nartimov <just.lest@gmail.com> | 2012-01-04 21:51:39 +0300 |
commit | ce2c4c977cf5437c35f3611ad48fb4682c1269ec (patch) | |
tree | e28353afad2da07cbc6c9f2069370061daa35690 | |
parent | 34551bf31e859c4d9aeaeae2b68bf2c338558b74 (diff) | |
download | rails-ce2c4c977cf5437c35f3611ad48fb4682c1269ec.tar.gz rails-ce2c4c977cf5437c35f3611ad48fb4682c1269ec.tar.bz2 rails-ce2c4c977cf5437c35f3611ad48fb4682c1269ec.zip |
simplify Class#descendants using singleton_class method
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/subclasses.rb | 2 |
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 |