Merge pull request #195 from lchenay/patch-3
Fix HEAD on relation hasMany
This commit is contained in:
commit
5cc2c5d92f
|
@ -397,6 +397,9 @@ RelationDefinition.hasMany = function hasMany(modelFrom, modelTo, params) {
|
|||
var updateByIdFunc = scopeMethods.updateById;
|
||||
modelFrom.prototype['__updateById__' + relationName] = updateByIdFunc;
|
||||
|
||||
var existsByIdFunc = scopeMethods.exists;
|
||||
modelFrom.prototype['__exists__' + relationName] = existsByIdFunc;
|
||||
|
||||
if(definition.modelThrough) {
|
||||
scopeMethods.create = scopeMethod(definition, 'create');
|
||||
scopeMethods.add = scopeMethod(definition, 'add');
|
||||
|
|
Loading…
Reference in New Issue