Search⌘ K
AI Features

Add quantity to the Placement Model

Understand how to add and migrate a quantity attribute to the Placement model in a Rails API. Learn to update fixtures and test your code to accurately track product quantities for better order handling.

We'll cover the following...

Notice that we are not saving the quantity for each product anywhere. Currently, we have no way to keep track of that. We can easily fix this just by adding a quantity attribute to the Placement model. By doing this, we save its corresponding quantity ...