codecombat/app/models/TrialRequest.coffee
2016-01-28 17:21:36 -08:00

21 lines
613 B
CoffeeScript

CocoModel = require './CocoModel'
schema = require 'schemas/models/trial_request.schema'
module.exports = class TrialRequest extends CocoModel
@className: 'TrialRequest'
@schema: schema
urlRoot: '/db/trial.request'
nameString: ->
props = @get('properties')
values = _.filter(_.at(props, 'name', 'email'))
return values.join(' / ')
locationString: ->
props = @get('properties')
values = _.filter(_.at(props, 'city', 'state', 'country'))
return values.join(' ')
educationLevelString: ->
levels = @get('properties').educationLevel or []
return levels.join(', ')