#START:initial
class LineItem < ActiveRecord::Base

  belongs_to :product

#END:initial
  def self.for_product(product)
    item = self.new         # <wtf linkend="wtf.self.new">self.new</wtf>
    item.quantity = 1
    item.product = product
    item.unit_price = product.price
    item
  end
#START:initial
end
#END:initial
