From 28e32598b9a99a2e5794e1ee8882ca42746ae513 Mon Sep 17 00:00:00 2001 From: Andy Lindeman Date: Sat, 10 Sep 2011 21:49:13 -0400 Subject: [PATCH] Fix for :instance_reader => false code example --- railties/guides/source/active_support_core_extensions.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index b2436a2e68..9e2fe2c694 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -1020,7 +1020,7 @@ class A class_attribute :x, :instance_reader => false end -A.x = 1 # NoMethodError +A.new.x = 1 # NoMethodError For convenience +class_attribute+ also defines an instance predicate which is the double negation of what the instance reader returns. In the examples above it would be called +x?+.