codecombat/codecombat — pull request #1394 by rubenvereecken (2014-07-28 19:28:11+00:00)
Title: First step towards fetching related by slug

I can now do the following: GET `http://localhost:3000/db/user/abraham-lincoln/level.sessions`.

The key was introducing `getBySlug` for all named schemas. I already did `level.sessions` and `earned.achievements`. Still needs to be a little bit more robust because I don't handle errors that very well. How do you check whether something is an Error? Didn't have time to check.

Anyway I'll leave this here. It's safe to pull. Will do some others tomorrow. All I need to do is throw `IDify` in there.