aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object/extending.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object/extending.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/object/extending.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/extending.rb b/activesupport/lib/active_support/core_ext/object/extending.rb
new file mode 100644
index 0000000000..c4c37b6a2a
--- /dev/null
+++ b/activesupport/lib/active_support/core_ext/object/extending.rb
@@ -0,0 +1,11 @@
+require 'active_support/core_ext/class/subclasses'
+
+class Object
+ # Exclude this class unless it's a subclass of our supers and is defined.
+ # We check defined? in case we find a removed class that has yet to be
+ # garbage collected. This also fails for anonymous classes -- please
+ # submit a patch if you have a workaround.
+ def subclasses_of(*superclasses) #:nodoc:
+ Class.subclasses_of(*superclasses)
+ end
+end