Fix the reference to modelBuilder/dataSource
This commit is contained in:
parent
e51c8971f9
commit
7f6398f4c5
|
@ -140,7 +140,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
|
|||
// every class can receive hash of data as optional param
|
||||
ModelClass = function ModelConstructor(data, dataSource) {
|
||||
if(!(this instanceof ModelConstructor)) {
|
||||
return new ModelConstructor(data, modelBuilder);
|
||||
return new ModelConstructor(data, dataSource);
|
||||
}
|
||||
if(ModelClass.settings.unresolved) {
|
||||
throw new Error('Model ' + ModelClass.modelName + ' is not defined.');
|
||||
|
@ -172,6 +172,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
|
|||
|
||||
// Add metadata to the ModelClass
|
||||
hiddenProperty(ModelClass, 'modelBuilder', modelBuilder);
|
||||
hiddenProperty(ModelClass, 'dataSource', modelBuilder); // Keep for back-compatibility
|
||||
hiddenProperty(ModelClass, 'pluralModelName', pluralName || inflection.pluralize(className));
|
||||
hiddenProperty(ModelClass, 'relations', {});
|
||||
|
||||
|
|
Loading…
Reference in New Issue