diff --git a/activesupport/lib/active_support/core_ext/class/attribute.rb b/activesupport/lib/active_support/core_ext/class/attribute.rb index cd7877fce4..7af3cebc34 100644 --- a/activesupport/lib/active_support/core_ext/class/attribute.rb +++ b/activesupport/lib/active_support/core_ext/class/attribute.rb @@ -108,8 +108,10 @@ class Class end end - private - def singleton_class? - ancestors.first != self +private + unless respond_to?(:singleton_class?) + def singleton_class? + ancestors.first != self + end end end