Topic: Depot Application stock control enhancement

I've been following the Depot Application from the Agile Web Development with Rails book.  I'm trying to add some stock control functionality.  i.e. if a customer buys a book (and hits the place order button) that a new field which I've added to the product table will be decremented.

Has anyone here done this already?  Would be great to get some pointers. 

Thanks in advance.