mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 16:17:57 -05:00
15 lines
394 B
CoffeeScript
15 lines
394 B
CoffeeScript
|
CocoModel = require './CocoModel'
|
||
|
schema = require 'schemas/models/prepaid.schema'
|
||
|
|
||
|
module.exports = class Prepaid extends CocoModel
|
||
|
@className: "Prepaid"
|
||
|
urlRoot: '/db/prepaid'
|
||
|
|
||
|
openSpots: ->
|
||
|
@get('maxRedeemers') - @get('redeemers')?.length
|
||
|
|
||
|
userHasRedeemed: (userID) ->
|
||
|
for redeemer in @get('redeemers')
|
||
|
return redeemer.date if redeemer.userID is userID
|
||
|
return null
|