aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_support_core_extensions.textile
diff options
context:
space:
mode:
authorAndy Lindeman <andy@highgroove.com>2011-09-10 21:49:13 -0400
committerAndy Lindeman <andy@highgroove.com>2011-09-10 21:49:13 -0400
commit28e32598b9a99a2e5794e1ee8882ca42746ae513 (patch)
tree67d4ced8ea15519bf8f5370f32d26c8537a45790 /railties/guides/source/active_support_core_extensions.textile
parent41d179b7d67f01234b28fd6e4f6dc9cf8ef2c8db (diff)
downloadrails-28e32598b9a99a2e5794e1ee8882ca42746ae513.tar.gz
rails-28e32598b9a99a2e5794e1ee8882ca42746ae513.tar.bz2
rails-28e32598b9a99a2e5794e1ee8882ca42746ae513.zip
Fix for :instance_reader => false code example
Diffstat (limited to 'railties/guides/source/active_support_core_extensions.textile')
-rw-r--r--railties/guides/source/active_support_core_extensions.textile2
1 files changed, 1 insertions, 1 deletions
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
</ruby>
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?+.