Permalink
Browse files

Fix for :instance_reader => false code example

  • Loading branch information...
1 parent 41d179b commit 28e32598b9a99a2e5794e1ee8882ca42746ae513 @alindeman alindeman committed Sep 11, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 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?+.

0 comments on commit 28e3259

Please sign in to comment.