Fix HEAD on relation hasMany

This commit is contained in:
Laurent Chenay 2014-07-28 11:36:32 +02:00
parent 1b001eedd3
commit 04a56e2ea6
1 changed files with 3 additions and 0 deletions

View File

@ -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');