Minor cleanup
This commit is contained in:
parent
00dfe563eb
commit
9f94ec9bde
|
@ -1074,14 +1074,14 @@ RelationDefinition.hasAndBelongsToMany = function hasAndBelongsToMany(modelFrom,
|
|||
options.polymorphic = params.polymorphic;
|
||||
var accessor = params.through.prototype[params.polymorphic];
|
||||
if (typeof accessor !== 'function') { // declare once
|
||||
params.through.belongsTo(modelTo);
|
||||
params.through.belongsTo(params.polymorphic, { polymorphic: true });
|
||||
}
|
||||
} else {
|
||||
params.through.belongsTo(modelFrom);
|
||||
params.through.belongsTo(modelTo);
|
||||
}
|
||||
|
||||
params.through.belongsTo(modelTo);
|
||||
|
||||
this.hasMany(modelFrom, modelTo, options);
|
||||
|
||||
};
|
||||
|
|
|
@ -161,7 +161,3 @@ RelationMixin.hasAndBelongsToMany = function hasAndBelongsToMany(modelTo, params
|
|||
RelationMixin.hasOne = function hasMany(modelTo, params) {
|
||||
RelationDefinition.hasOne(this, modelTo, params);
|
||||
};
|
||||
|
||||
RelationMixin.belongsToPolymorphic = function belongsToPolymorphic(polymorphic, params) {
|
||||
RelationDefinition.belongsToPolymorphic(this, polymorphic, params);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue