aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2010-02-09 18:03:14 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2010-02-09 18:20:57 -0800
commitd1938953f416ac945b591251567d51e30ee2a6a4 (patch)
tree9f0b99f6d01a6e955a1a2a7a42ef4b68cee52478 /activesupport/lib/active_support/core_ext/object
parentfa2ff95d4b783751f42378447331385c469e4775 (diff)
downloadrails-d1938953f416ac945b591251567d51e30ee2a6a4.tar.gz
rails-d1938953f416ac945b591251567d51e30ee2a6a4.tar.bz2
rails-d1938953f416ac945b591251567d51e30ee2a6a4.zip
Reinstate Object.subclasses_of and Class#descendents for plugin compat.
This reverts commits 7d312e54bad9c39634c137caec07dfc8df471650, 5f981ff0294ba45aa44ad15aa063970b29aeec44, f85f5dfc8ffefff174b695c6363211d342f77a57, 245bfafe335ff883f7a096eab95ac22fe2848679, and ec7c642f5fe60afc857aa64f1a9b4c2be56f9d70
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object')
-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