aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-07-23 20:02:03 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-07-23 20:02:03 -0700
commitcdc4274931c2d6bafdf2b97f7e4ecedf89a8202e (patch)
tree361a4917026067f207dd1391020360b356cd30c7 /activesupport
parent06c52d6ac93cb263abce6abfbef91a7a3a3e3d6a (diff)
downloadrails-cdc4274931c2d6bafdf2b97f7e4ecedf89a8202e.tar.gz
rails-cdc4274931c2d6bafdf2b97f7e4ecedf89a8202e.tar.bz2
rails-cdc4274931c2d6bafdf2b97f7e4ecedf89a8202e.zip
simplify singleton_class? method
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/class/attribute.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/attribute.rb b/activesupport/lib/active_support/core_ext/class/attribute.rb
index ca9b2c1b60..45bec264ff 100644
--- a/activesupport/lib/active_support/core_ext/class/attribute.rb
+++ b/activesupport/lib/active_support/core_ext/class/attribute.rb
@@ -110,12 +110,6 @@ class Class
private
def singleton_class?
- # in case somebody is crazy enough to overwrite allocate
- allocate = Class.instance_method(:allocate)
- # object.class always points to a real (non-singleton) class
- allocate.bind(self).call.class != self
- rescue TypeError
- # MRI/YARV/JRuby all disallow creating new instances of a singleton class
- true
+ !name || '' == name
end
end