diff options
author | Vipul A M <vipulnsward@gmail.com> | 2013-10-14 22:40:21 +0530 |
---|---|---|
committer | Vipul A M <vipulnsward@gmail.com> | 2013-10-15 00:07:16 +0530 |
commit | 8b14a6b76898e34ceb6da7e683155dfd3f8c85c0 (patch) | |
tree | f432f88c78c69bd4afdfd73dfa51b4cd58c32ada | |
parent | 42a99dbaba3f9968f800d24dfdb60c51bee091b1 (diff) | |
download | rails-8b14a6b76898e34ceb6da7e683155dfd3f8c85c0.tar.gz rails-8b14a6b76898e34ceb6da7e683155dfd3f8c85c0.tar.bz2 rails-8b14a6b76898e34ceb6da7e683155dfd3f8c85c0.zip |
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
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/attribute.rb | 7 |
1 files changed, 5 insertions, 2 deletions
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 |