This commit is contained in:
Scott Erickson 2015-01-08 11:28:52 -08:00
parent 68ed142bd6
commit d8e89f31b1
3 changed files with 3 additions and 3 deletions

View file

@ -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'}

View file

@ -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'})

View file

@ -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