aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/class
diff options
context:
space:
mode:
authorYehuda Katz <wycats@Yehuda-Katz.local>2009-12-13 06:29:50 -0500
committerYehuda Katz <wycats@Yehuda-Katz.local>2009-12-13 10:39:10 -0500
commit0f7f90d25bece35194b2d0035de8874e869d299e (patch)
tree62e732b0022b50c177e7c9288c7d7f8a63c6b5e8 /activesupport/lib/active_support/core_ext/class
parent25bb301d9c392d7c38ac8e6f5b64ed64e7b95022 (diff)
downloadrails-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')
-rw-r--r--activesupport/lib/active_support/core_ext/class/removal.rb6
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.
#