aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object/extending.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-02-14 19:28:05 +0000
committerPratik Naik <pratiknaik@gmail.com>2010-02-14 19:28:05 +0000
commit6f3c5f67870a625b8be4de6e34e8d0d2f5d2b5e3 (patch)
tree3da8d75101aabe3c1d90d0582505ec1480c9d885 /activesupport/lib/active_support/core_ext/object/extending.rb
parent77bf78b3b78a41d4f2f6e733f5c9c00608c0adba (diff)
parenta1b60696e2b13cbe94d748444cc0da37b190fbb8 (diff)
downloadrails-6f3c5f67870a625b8be4de6e34e8d0d2f5d2b5e3.tar.gz
rails-6f3c5f67870a625b8be4de6e34e8d0d2f5d2b5e3.tar.bz2
rails-6f3c5f67870a625b8be4de6e34e8d0d2f5d2b5e3.zip
Merge remote branch 'mainstream/master'
Conflicts: railties/README railties/guides/source/active_support_core_extensions.textile railties/guides/source/getting_started.textile railties/lib/generators/rails/app/templates/README
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