codecombat/app/models/Campaign.coffee
Scott Erickson ea4a98af86 Add rest of CoursesView, untested, unhooked to server
On a plane, so skipping my usual iterative testing.
Bugs are undoubtedly everywhere.
2015-11-23 08:46:08 -08:00

14 lines
547 B
CoffeeScript

CocoModel = require './CocoModel'
schema = require 'schemas/models/campaign.schema'
Level = require 'models/Level'
module.exports = class Campaign extends CocoModel
@className: 'Campaign'
@schema: schema
urlRoot: '/db/campaign'
saveBackups: true
@denormalizedLevelProperties: _.keys(_.omit(schema.properties.levels.additionalProperties.properties, ['unlocks', 'position', 'rewards']))
@denormalizedCampaignProperties: ['name', 'i18n', 'slug']
levelsCollection: ->
new CocoCollection(_.values(@get('levels')), {model: Level})