Skip to content

Commit

Permalink
Revise associations guide: no need to set default on counter_cache co…
Browse files Browse the repository at this point in the history
…lumns.
  • Loading branch information
Mike Gunderloy authored and Mike Gunderloy committed Oct 4, 2008
1 parent 2fc835d commit 1728b8b
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions railties/doc/guides/activerecord/association_basics.txt
Expand Up @@ -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.
Expand Down

0 comments on commit 1728b8b

Please sign in to comment.