tgriesser/bookshelf — pull request #199 by bendrucker (2014-01-18 23:35:02+00:00)
Title: Allows models to be registered with a string name

We've had a lot of people post issues related to circular dependencies.

Mongoose solves this by registering models on the module such that you can access any model using `mongoose.model('ModelName')`. That also means that model relations can be defined with like this:`referenceToModelName: {ref: 'ModelName'}`.

This seems like a good way to handle things and the consensus in the most recent discussion (#181) was `Bookshelf.register(model, 'registeredName');`.

Steps:

- [x] Tests
- [x] Code
- [x] Documentation — change all relations examples to the string syntax

I'm going to take a look at this this weekend.