From c4a29de0e0706c7a8e7641f099eedaaf60c185ec Mon Sep 17 00:00:00 2001
From: Aaron Patterson <aaron.patterson@gmail.com>
Date: Tue, 3 Jan 2012 13:10:11 -0800
Subject: Merge pull request #4283 from lest/fix-singleton-checking

use correct variant of checking whether class is a singleton
---
 activesupport/lib/active_support/core_ext/class/attribute.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/activesupport/lib/active_support/core_ext/class/attribute.rb b/activesupport/lib/active_support/core_ext/class/attribute.rb
index 45bec264ff..305ed4964b 100644
--- a/activesupport/lib/active_support/core_ext/class/attribute.rb
+++ b/activesupport/lib/active_support/core_ext/class/attribute.rb
@@ -110,6 +110,6 @@ class Class
 
   private
   def singleton_class?
-    !name || '' == name
+    ancestors.first != self
   end
 end
-- 
cgit v1.2.3