loopback/lib
Miroslav Bajtoš f844459311 Add createModelFromConfig and configureModel()
Add new API allowing developers to split the model definition and
configuration into two steps:

 1. Build models from JSON config, export them for re-use:

  ```js
  var Customer = loopback.createModelFromConfig({
    name: 'Customer',
    base: 'User',
    properties: {
      address: 'string'
    }
  });
  ```

 2. Attach existing models to a dataSource and a loopback app,
    modify certain model aspects like relations:

  ```js
  loopback.configureModel(Customer, {
    dataSource: db,
    relations: { /* ... */ }
  });
  ```

Rework `app.model` to use `loopback.configureModel` under the hood.
Here is the new usage:

```js
var Customer = require('./models').Customer;

app.model(Customer, {
  dataSource: 'db',
  relations: { /* ... */ }
});
```

In order to preserve backwards compatibility with loopback 1.x,
`app.model(name, config)` calls both `createModelFromConfig`
and `configureModel`.
2014-06-05 17:47:28 +02:00
..
connectors - Use the RemoteObjects class to find remote objects instead of 2014-05-19 15:56:26 -07:00
middleware Modify `loopback.rest` to include `loopback.token` 2014-05-21 15:22:36 +02:00
models Merge latest from master 2014-05-20 14:31:09 -07:00
application.js Add createModelFromConfig and configureModel() 2014-06-05 17:47:28 +02:00
browser-express.js Make app.get/app.set available in browser 2014-06-03 21:32:27 +02:00
compat.js Add loopback.compat to simplify upgrade to 1.6 2014-01-27 10:29:57 +01:00
express-middleware.js Exclude express-middleware from browser bundle 2014-06-03 21:32:27 +02:00
loopback.js Add createModelFromConfig and configureModel() 2014-06-05 17:47:28 +02:00