codecombat/server/courses/CourseInstance.coffee
2015-08-29 07:15:39 -07:00

20 lines
737 B
CoffeeScript

mongoose = require 'mongoose'
config = require '../../server_config'
plugins = require '../plugins/plugins'
jsonSchema = require '../../app/schemas/models/course_instance.schema'
CourseInstanceSchema = new mongoose.Schema {}, {strict: false, minimize: false, read:config.mongo.readpref}
CourseInstanceSchema.plugin plugins.NamedPlugin
CourseInstanceSchema.plugin plugins.SearchablePlugin, {searchable: ['name', 'description']}
CourseInstanceSchema.statics.privateProperties = []
CourseInstanceSchema.statics.editableProperties = [
'description'
'members'
'name'
]
CourseInstanceSchema.statics.jsonSchema = jsonSchema
module.exports = CourseInstance = mongoose.model 'course.instance', CourseInstanceSchema, 'course.instances'