By the way there is counter_culture[1] which is great for more complex counter caches:
Inventory:
product quantity
1 2
1 5
2 -1
2 3
2 10
And having a counter cache for the sum per product (e.g.: product.inventory_quantity).