mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 10:56:53 -05:00
Fixed #1967.
This commit is contained in:
parent
68ed142bd6
commit
d8e89f31b1
3 changed files with 3 additions and 3 deletions
|
@ -27,7 +27,7 @@ module.exports =
|
||||||
triggeredBy: c.objectId()
|
triggeredBy: c.objectId()
|
||||||
achievementName: type: 'string'
|
achievementName: type: 'string'
|
||||||
created: type: 'date'
|
created: type: 'date'
|
||||||
changed: type: 'date'
|
changed: type: ['date', 'string', 'number'] # TODO: migrate timestamps and Date objects all to ISO strings
|
||||||
achievedAmount: type: 'number'
|
achievedAmount: type: 'number'
|
||||||
earnedPoints: type: 'number'
|
earnedPoints: type: 'number'
|
||||||
previouslyAchievedAmount: {type: 'number'}
|
previouslyAchievedAmount: {type: 'number'}
|
||||||
|
|
|
@ -10,7 +10,7 @@ EarnedAchievementSchema = new mongoose.Schema({
|
||||||
}, {strict:false})
|
}, {strict:false})
|
||||||
|
|
||||||
EarnedAchievementSchema.pre 'save', (next) ->
|
EarnedAchievementSchema.pre 'save', (next) ->
|
||||||
@set('changed', Date.now())
|
@set('changed', new Date())
|
||||||
next()
|
next()
|
||||||
|
|
||||||
EarnedAchievementSchema.index({user: 1, achievement: 1}, {unique: true, name: 'earned achievement index'})
|
EarnedAchievementSchema.index({user: 1, achievement: 1}, {unique: true, name: 'earned achievement index'})
|
||||||
|
|
|
@ -23,7 +23,7 @@ LevelSessionSchema.post 'init', (doc) ->
|
||||||
|
|
||||||
LevelSessionSchema.pre 'save', (next) ->
|
LevelSessionSchema.pre 'save', (next) ->
|
||||||
User = require '../../users/User' # Avoid mutual inclusion cycles
|
User = require '../../users/User' # Avoid mutual inclusion cycles
|
||||||
@set('changed', new Date())
|
@set('changed', new Date().toISOString())
|
||||||
|
|
||||||
id = @get('id')
|
id = @get('id')
|
||||||
initd = id of previous
|
initd = id of previous
|
||||||
|
|
Loading…
Reference in a new issue