airbrite/bookshelf — pull request #1 by badave (2013-11-25 09:56:45+00:00)
Title: Constructor

Setting up for mongodb:

* Bookshelf can be initialized the same way still
````javascript
bookshelf = new Bookshelf(knex_or_config); // still works
bookshelf = Bookshelf.initialize(knex_or_config); // still works
bookshelf.Model // still good
bookshelf.Collection // still good
````

* Bookshelf does not need to be initialized for the models to be usable

````javascript
Bookshelf.Model // statically available
Bookshelf.Collection // statically available
````

* Bookshelf Model and Collection both utilize .db now

````javascript
var OtherModel = Bookshelf.Model.extend({
db: knex_or_other_db
// _.builder will use this db
});
````

* A bookshelf instance Model and Collection will automatically use the knex or db created on init
* A Collection will attempt to use its model's db if it does not have one explicitly declared