Permalink
Browse files

simplify singleton_class? method

  • Loading branch information...
1 parent 06c52d6 commit cdc4274931c2d6bafdf2b97f7e4ecedf89a8202e @tenderlove tenderlove committed Jul 24, 2011
Showing with 1 addition and 7 deletions.
  1. +1 −7 activesupport/lib/active_support/core_ext/class/attribute.rb
@@ -110,12 +110,6 @@ def #{name}?
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

0 comments on commit cdc4274

Please sign in to comment.