mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Merge branch 'master' into production
This commit is contained in:
commit
6c1f7c789a
2 changed files with 8 additions and 0 deletions
|
@ -501,6 +501,9 @@ module.exports = class Handler
|
|||
if Handler.isID(idOrSlug)
|
||||
query = @modelClass.findById(idOrSlug)
|
||||
else
|
||||
if not idOrSlug or idOrSlug is 'undefined'
|
||||
console.error "What? Why are we fetching the slug: #{idOrSlug}?"
|
||||
console.trace()
|
||||
query = @modelClass.findOne {slug: idOrSlug}
|
||||
query.select projection if projection
|
||||
query.exec (err, document) ->
|
||||
|
|
|
@ -11,6 +11,11 @@ CourseInstanceSchema = new mongoose.Schema {
|
|||
members: [mongoose.Schema.Types.ObjectId]
|
||||
}, {strict: false, minimize: false, read:config.mongo.readpref}
|
||||
|
||||
CourseInstanceSchema.index({ownerID: 1}, {name: 'ownerID index'})
|
||||
CourseInstanceSchema.index({members: 1}, {name: 'members index'})
|
||||
CourseInstanceSchema.index({classroomID: 1}, {name: 'classroomID index', sparse: true})
|
||||
CourseInstanceSchema.index({prepaidID: 1}, {name: 'prepaidID index', sparse: true}) # Deprecated? Can we get rid of this?
|
||||
|
||||
CourseInstanceSchema.statics.privateProperties = []
|
||||
CourseInstanceSchema.statics.editableProperties = [
|
||||
'description'
|
||||
|
|
Loading…
Reference in a new issue