From 8b14a6b76898e34ceb6da7e683155dfd3f8c85c0 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Mon, 14 Oct 2013 22:40:21 +0530 Subject: Fix `singleton_class?` Due to changes from http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/39628 current `singleton_class?` implementation fails. Changed based on reference from http://bugs.ruby-lang.org/issues/7609 --- activesupport/lib/active_support/core_ext/class/attribute.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/core_ext/class/attribute.rb b/activesupport/lib/active_support/core_ext/class/attribute.rb index 83038f9da5..f2a221c396 100644 --- a/activesupport/lib/active_support/core_ext/class/attribute.rb +++ b/activesupport/lib/active_support/core_ext/class/attribute.rb @@ -118,7 +118,10 @@ class Class end private - def singleton_class? - ancestors.first != self + + unless respond_to?(:singleton_class?) + def singleton_class? + ancestors.first != self + end end end -- cgit v1.2.3