aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/class
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-04-01 17:18:24 -0700
committerCarl Lerche <carllerche@mac.com>2010-04-01 17:18:42 -0700
commitab281f511ccb3893ea077fe8a7bb78cdd2db0885 (patch)
treebd8f699175141c682f6d7489e543e7ad79d59159 /activesupport/lib/active_support/core_ext/class
parentf0364d87f03d58312bcab1b2f17b5b56b6c72653 (diff)
downloadrails-ab281f511ccb3893ea077fe8a7bb78cdd2db0885.tar.gz
rails-ab281f511ccb3893ea077fe8a7bb78cdd2db0885.tar.bz2
rails-ab281f511ccb3893ea077fe8a7bb78cdd2db0885.zip
Fix class_attribute so that it works with singleton classes.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/class')
-rw-r--r--activesupport/lib/active_support/core_ext/class/attribute.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/attribute.rb b/activesupport/lib/active_support/core_ext/class/attribute.rb
index 9631a7d242..577d5cbf45 100644
--- a/activesupport/lib/active_support/core_ext/class/attribute.rb
+++ b/activesupport/lib/active_support/core_ext/class/attribute.rb
@@ -50,7 +50,7 @@ class Class
singleton_class.send(:define_method, attr) { value }
end
- define_method(attr) { self.class.send(attr) }
+ define_method(attr) { self.singleton_class.send(attr) }
define_method(:"#{attr}?") { !!send(attr) }
define_method(:"#{attr}=") do |value|
singleton_class.remove_possible_method(attr)