attr = DS.attr
App.ProductOrder = DS.Model.extend
  quantity: attr 'number', defaultValue: 1
  product: DS.belongsTo('product')
  product_name: attr('string')
  order: DS.belongsTo('order')
  placed: attr('boolean', defaultValue: false)
  increment: ->
    @set('quantity', @get('quantity') + 1)
  total: (-> @get('quantity') * @get('product.price')).property('quantity')
  setOrder: (order)->
    @set('placed', true)
    @set('order', order)


