Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
session[:cart] << inventory_item << inventory_item << inventory_item customer adds inventory to cart. Calculate total price taking into account volume discounts on the fly. When they checkout, formalize this on the order and line item tables: line_items table: order_id,inventory_id,qty,price_plan_id,customer_price,ready_to_ship_at,shipped_at,package_id one line item per unique inventory item. package_id if you're going to part-ship orders... then you could have order has_many :packages but that's getting a bit complex. orders table: created_at,updated_at,user_id,payment_status,fulfillment_status,fulfilled_at line_items_orders table: line_item_id,order_id Order has_and_belongs_to_many :line_items belongs_to :user LineItem has_and_belongs_to_many :orders belongs_to :inventory
From the Design Piracy series on my blog: