Extending the Placement Model
Explore how to extend the placement model to manage product quantities accurately, decrement stock after orders, and validate these updates through testing. This lesson helps you implement and test essential order management features in your Rails API.
We'll cover the following...
We'll cover the following...
Now that we have added the quantity attribute, let’s keep a correct record of the stock by decrementing the products from the stock once the order is placed. We will update the product quantity once the order is saved ...