mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 00:28:31 -05:00
16 lines
448 B
CoffeeScript
16 lines
448 B
CoffeeScript
|
CocoModel = require('./CocoModel')
|
||
|
|
||
|
module.exports = class Purchase extends CocoModel
|
||
|
@className: "Purchase"
|
||
|
urlRoot: "/db/purchase"
|
||
|
@schema: require 'schemas/models/purchase.schema'
|
||
|
|
||
|
@makeFor: (toPurchase) ->
|
||
|
purchase = new Purchase({
|
||
|
recipient: me.id
|
||
|
purchaser: me.id
|
||
|
purchased: {
|
||
|
original: toPurchase.get('original')
|
||
|
collection: _.string.underscored toPurchase.constructor.className
|
||
|
}
|
||
|
})
|