app/models/order_item.rb
# check to see how much of this item has already shipped
check to see how much of this item has already shipped
check to see how much of this item has already shipped
def quantity_shipped
    qty = ShipmentItem.joins(:shipment)
              .where("store_shipments.status = 'shipped' AND order_item_id = ?", id)
              .sum(:quantity)
  end
def quantity_shipped qty = ShipmentItem . joins ( :shipment ) . where ( "store_shipments.status = 'shipped' AND order_item_id = ?" , id ) . sum ( :quantity ) end
check to see how much of this item has already shipped
check to see how much of this item has already shipped