#START:belongs_to
class LineItem < ActiveRecord::Base

  belongs_to :product
  belongs_to :order

  # . . .
#END:belongs_to
  def self.for_product(product)
    item = self.new
    item.quantity = 1
    item.product = product
    item.unit_price = product.price
    item
  end
end

