I added a counter cache but can't get it to update. But I can update the parent - the Blog Post model by adding a new blog post - and I can update the child - Comments model - by adding a new comment. The counter cache is supposed to keep track of the total number of comments per blog post by auto-updating the blog_posts.comments_count field. I'll outline some of the steps I went through and hopefully someone will notice something I did wrong. The schema dump is at the end.

Is there a particular reason why the table for your Post model can't be named "posts"? And why are you manually specifying the class_name and foreign_key all over the place? It looks like you should only need to do it for your Author model which is backed by a "users" table. There seems to be a lot of fighting the Rails defaults going on.
–
John TopleyMay 24 '09 at 8:59

I'm following a tutorial which shows you how to work around the defaults if you need to.
–
pez_dispenserMay 24 '09 at 17:17

OK, but for most of your example you actually don't need to.
–
John TopleyMay 24 '09 at 17:24

Duly noted. I was afraid you were going to point out that my comments model shouldn't have a foreign key on author_id because this means that only the authors of blog posts can write comments.
–
pez_dispenserMay 24 '09 at 17:34