diff options
author | Xavier Noria <fxn@hashref.com> | 2012-01-04 10:59:38 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-01-04 10:59:38 -0800 |
commit | 33386b065c8dc029f0c5f31188fdc4c12e1d7293 (patch) | |
tree | e28353afad2da07cbc6c9f2069370061daa35690 /activesupport/lib/active_support | |
parent | 34551bf31e859c4d9aeaeae2b68bf2c338558b74 (diff) | |
parent | ce2c4c977cf5437c35f3611ad48fb4682c1269ec (diff) | |
download | rails-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.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 |