HabitRPG/habitrpg — pull request #1650 by paglias (2013-10-27 09:22:38+00:00)
Title: Fix #1647

@lefnire this is a fix for #1647: new users object are created with an undefined `user.achievements` so it returns an error when it tried to set the first streak achievement.

I tried to set a default for `user.achievements` but since I couldn't find how to do so because it's an object which stores other fields I added the default for `user.achievements.streak`.

There's also a db migration to create `user.achievements` for users without it.