mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -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()
|
||||
achievementName: type: 'string'
|
||||
created: type: 'date'
|
||||
changed: type: 'date'
|
||||
changed: type: ['date', 'string', 'number'] # TODO: migrate timestamps and Date objects all to ISO strings
|
||||
achievedAmount: type: 'number'
|
||||
earnedPoints: type: 'number'
|
||||
previouslyAchievedAmount: {type: 'number'}
|
||||
|
|
|
@ -10,7 +10,7 @@ EarnedAchievementSchema = new mongoose.Schema({
|
|||
}, {strict:false})
|
||||
|
||||
EarnedAchievementSchema.pre 'save', (next) ->
|
||||
@set('changed', Date.now())
|
||||
@set('changed', new Date())
|
||||
next()
|
||||
|
||||
EarnedAchievementSchema.index({user: 1, achievement: 1}, {unique: true, name: 'earned achievement index'})
|
||||
|
|
|
@ -23,7 +23,7 @@ LevelSessionSchema.post 'init', (doc) ->
|
|||
|
||||
LevelSessionSchema.pre 'save', (next) ->
|
||||
User = require '../../users/User' # Avoid mutual inclusion cycles
|
||||
@set('changed', new Date())
|
||||
@set('changed', new Date().toISOString())
|
||||
|
||||
id = @get('id')
|
||||
initd = id of previous
|
||||
|
|
Loading…
Reference in a new issue