Refactor Model and PersistedModel registration

Modify the files to export a model factory function accepting
a `registry` argument. This is a preparation step for per-application
models - see #1212.
This commit is contained in:
Miroslav Bajtoš 2015-04-03 09:26:19 +02:00
parent 72d547971a
commit c72c134d80
3 changed files with 2116 additions and 2107 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -431,8 +431,8 @@ registry.DataSource = DataSource;
* @private
*/
registry.Model = require('./model');
registry.PersistedModel = require('./persisted-model');
registry.Model = require('./model')(registry);
registry.PersistedModel = require('./persisted-model')(registry);
// temporary alias to simplify migration of code based on <=2.0.0-beta3
Object.defineProperty(registry, 'DataModel', {