diff options
author | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-12-13 06:29:50 -0500 |
---|---|---|
committer | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-12-13 10:39:10 -0500 |
commit | 0f7f90d25bece35194b2d0035de8874e869d299e (patch) | |
tree | 62e732b0022b50c177e7c9288c7d7f8a63c6b5e8 /activesupport/lib/active_support/core_ext/class/removal.rb | |
parent | 25bb301d9c392d7c38ac8e6f5b64ed64e7b95022 (diff) | |
download | rails-0f7f90d25bece35194b2d0035de8874e869d299e.tar.gz rails-0f7f90d25bece35194b2d0035de8874e869d299e.tar.bz2 rails-0f7f90d25bece35194b2d0035de8874e869d299e.zip |
Extract descendents a bit so it can take advantage of Rubinius' __subclasses__.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/class/removal.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/removal.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/removal.rb b/activesupport/lib/active_support/core_ext/class/removal.rb index 2dea3c24d5..652be4ed78 100644 --- a/activesupport/lib/active_support/core_ext/class/removal.rb +++ b/activesupport/lib/active_support/core_ext/class/removal.rb @@ -2,7 +2,11 @@ require 'active_support/core_ext/object/extending' require 'active_support/core_ext/module/introspection' class Class #:nodoc: - + + def reachable? + eval("defined?(::#{self}) && ::#{self}.equal?(self)") + end + # Unassociates the class with its subclasses and removes the subclasses # themselves. # |