Fix HasOne PK on modelFrom instead of modelTo
This commit is contained in:
parent
0f0a9282b0
commit
9eaeb9e399
|
@ -1417,7 +1417,7 @@ RelationDefinition.hasOne = function (modelFrom, modelTo, params) {
|
||||||
params = params || {};
|
params = params || {};
|
||||||
modelTo = lookupModelTo(modelFrom, modelTo, params);
|
modelTo = lookupModelTo(modelFrom, modelTo, params);
|
||||||
|
|
||||||
var pk = modelTo.dataSource.idName(modelTo.modelName) || 'id';
|
var pk = modelFrom.dataSource.idName(modelFrom.modelName) || 'id';
|
||||||
var relationName = params.as || i8n.camelize(modelTo.modelName, true);
|
var relationName = params.as || i8n.camelize(modelTo.modelName, true);
|
||||||
|
|
||||||
var fk = params.foreignKey || i8n.camelize(modelFrom.modelName + '_id', true);
|
var fk = params.foreignKey || i8n.camelize(modelFrom.modelName + '_id', true);
|
||||||
|
|
Loading…
Reference in New Issue