不要怂,就是干,撸起袖子干!

Commit 4f82f320 by Jan Aagaard Meier

Explictly check that an association is a hasMany before trying to pair it in has…

…Many. Inspired by #2159
1 parent bdaa3f4d
Showing with 1 additions and 1 deletions
...@@ -86,7 +86,7 @@ module.exports = (function() { ...@@ -86,7 +86,7 @@ module.exports = (function() {
*/ */
if (this.through) { if (this.through) {
_.each(this.target.associations, function(association, accessor) { _.each(this.target.associations, function(association, accessor) {
if (self.source === association.target) { if (self.source === association.target && association.associationType === 'HasMany') {
var paired; var paired;
// If through is default, we determine pairing by the accesor value (i.e. DAOFactory's using as won't pair, but regular ones will) // If through is default, we determine pairing by the accesor value (i.e. DAOFactory's using as won't pair, but regular ones will)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!