loopback/test
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
..
e2e Move replication implementation to DataModel 2014-05-06 13:31:23 -07:00
fixtures Clean up the tests 2014-05-29 10:18:14 -07:00
util Make app.get/app.set available in browser 2014-06-03 21:32:27 +02:00
access-control.integration.js Add hidden property support to models 2014-03-21 12:53:04 -07:00
access-token.test.js Merge branch 'master' into 2.0 2014-05-28 18:41:36 +02:00
acl.test.js Merge branch 'master' into 2.0 2014-05-28 18:41:36 +02:00
app.test.js Add createModelFromConfig and configureModel() 2014-06-05 17:47:28 +02:00
change.test.js - Use the RemoteObjects class to find remote objects instead of 2014-05-19 15:56:26 -07:00
data-source.test.js - Use the RemoteObjects class to find remote objects instead of 2014-05-19 15:56:26 -07:00
email.test.js Fix race condition where MyEmail model was not attached to the correct dataSource in tests 2014-01-23 14:25:54 -08:00
geo-point.test.js test/geo-point: relax too precise assertions 2014-05-16 16:24:18 +02:00
hidden-properties.test.js All tests passing 2014-05-02 21:19:14 -07:00
integration.test.js Add test for request pausing during authentication 2014-03-18 08:43:24 +01:00
loopback.test.js Add createModelFromConfig and configureModel() 2014-06-05 17:47:28 +02:00
memory.test.js Add memory docs and test 2013-07-16 13:39:03 -07:00
model.application.test.js Remove the generated flag as the id is set by the before hook 2014-03-17 10:01:29 -07:00
model.test.js Make app.get/app.set available in browser 2014-06-03 21:32:27 +02:00
relations.integration.js - Use the RemoteObjects class to find remote objects instead of 2014-05-19 15:56:26 -07:00
remote-connector.test.js Rework replication test 2014-05-15 17:30:58 -07:00
remoting.integration.js Allow app.model() to accept a DataSource instance 2014-03-21 12:18:00 -07:00
replication.test.js - Use the RemoteObjects class to find remote objects instead of 2014-05-19 15:56:26 -07:00
rest.middleware.test.js Modify `loopback.rest` to include `loopback.token` 2014-05-21 15:22:36 +02:00
role.test.js Make sure User/AccessToken relations are set up by default 2014-02-14 10:31:30 -08:00
support.js !fixup RemoteConnector tests 2014-05-02 20:04:06 -07:00
user.test.js Relax validation object test 2014-05-20 14:39:28 -07:00