From ab281f511ccb3893ea077fe8a7bb78cdd2db0885 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 1 Apr 2010 17:18:24 -0700 Subject: Fix class_attribute so that it works with singleton classes. --- activesupport/lib/active_support/core_ext/class/attribute.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support') 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) -- cgit v1.2.3