title: Rails 5.2 - How to implement quantity availability check with cart booking app?
body: <p>Im building a Golf Cart rental app where Users can Book Golf Carts, what I need help with is implementing a Quantity and Availability check where when a cart is booked, the quantity is subtracted by 1 UNTIL the booking end date, and if quantity is currently 0 the cart is considered unavailable and unbookable. Im using Rails 5.2, </p>
  
  <p>I have a Devise User model with added first and last name. A Cart model with name, description, quantity, and price columns. And a Booking model with start date, end date, user_id and cart_id columns. A User has_many bookings, a cart has_many bookings, and a booking belongs_to User. </p>
  
  <p>I've been trying it on my own for days and no answers on here take into account the quantity aspect that I'm looking for.</p>