strongloop/loopback — pull request #69 by ritch (2013-11-19 00:17:50+00:00)
Title: Initial auto wiring for model dataSources

/to @raymondfeng

This patch allows you `autoAttach` model's to default `DataSource`s by `type`.

```js
var ds = loopback.memory();
loopback.setDefaultDataSourceForType('my-type', ds); // or specify a ds to be created
var MyModel = loopback.Model.extend('MyModel');
MyModel.autoAttach = 'my-type';
loopback.autoAttach();
assert(MyModel.dataSource === ds);
```