diff options
author | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-10-04 08:31:50 -0500 |
---|---|---|
committer | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-10-04 08:31:50 -0500 |
commit | 1728b8bc919b7c6ff9c5056542ac01bef35f1171 (patch) | |
tree | a698679a45c85e7266ced6fc632dd91c95d658ba | |
parent | 2fc835d646ec4c420639a2b5e8edd5fb204c0414 (diff) | |
download | rails-1728b8bc919b7c6ff9c5056542ac01bef35f1171.tar.gz rails-1728b8bc919b7c6ff9c5056542ac01bef35f1171.tar.bz2 rails-1728b8bc919b7c6ff9c5056542ac01bef35f1171.zip |
Revise associations guide: no need to set default on counter_cache columns.
-rw-r--r-- | railties/doc/guides/activerecord/association_basics.txt | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/railties/doc/guides/activerecord/association_basics.txt b/railties/doc/guides/activerecord/association_basics.txt index b91052f91f..f9ec7a5f55 100644 --- a/railties/doc/guides/activerecord/association_basics.txt +++ b/railties/doc/guides/activerecord/association_basics.txt @@ -698,8 +698,6 @@ end Counter cache columns are added to the containing model's list of read-only attributes through +attr_readonly+. -WARNING: When you create a counter cache column in the database, be sure to specify a default value of zero. Otherwise, Rails will not properly maintain the counter. - ===== +:dependent+ If you set the +:dependent+ option to +:destroy+, then deleting this object will call the destroy method on the associated object to delete that object. If you set the +:dependent+ option to +:delete+, then deleting this object will delete the associated object _without_ calling its +destroy+ method. |