Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 7bfb16b51b
Fetching contributors…

Cannot retrieve contributors at this time

16 lines (13 sloc) 0.372 kb
class Lineitem < ActiveRecord::Base
attr_accessible :order_id, :product_id, :quantity, :unit_price
belongs_to :product
belongs_to :order
# # # # next feature, receiving quantity...
def self.add_product(product)
item = self.new
item.quantity = 1
item.product = product
#record the price during the sale
item.unit_price = product.price
end
end
Jump to Line
Something went wrong with that request. Please try again.