I have Product class which contains the attribute :quantity to keep track of how many of those I have in stock.
I have a Order class which has_many Items, and the Item class also has an attribute :quantity to record how many of a product was ordered. When an item is added to an order the Item.quantity is specified. This amount needs to be deducted from the Product.quantity. Not difficult. When an item is deleted from an order, the Item.quantity needs to be added to the Product.quantity. Not difficult. However, How would I go about re-adjusting the Product.quantity when an item.quantity is CHANGED? It seems like it should be a trivial thing, but I'm not able to wrap my brain around it. Thanks for any help. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

