Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fixes #1389] Problems with Through Associations with custom columnNames #1392

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pberba
Copy link

@pberba pberba commented Sep 9, 2016

I think this fixes issue #1389 (same as #1375 #1388) , when dealing with through associations, waterlines' many-to-many fails when custom columnNames of the join table is defined.

\node_modules\sails\node_modules\waterline\lib\waterline\model\lib\associationMethods\add.js:293
  var associationKey = collectionAttributes.attributes[attribute.on].via;
                                                                    ^

TypeError: Cannot read property 'via' of undefined

There seems to be a mix up with attribute.on and attribute.via, which is only different when the default columnNames are not used in a through association.

@sailsbot
Copy link

sailsbot commented Sep 9, 2016

Hi @pepeberba! It looks like your pull request title doesn’t quite conform to our guidelines. Please edit the title so that it starts with [proposal], [patch], [fixes #], or [implements #]. Once you've fixed it, post a comment below (e.g. "ok, fixed!") and we'll take a look!

@pberba pberba changed the title [fix #1389] Problems with Through Associations with custom columnNames [fixes #1389] Problems with Through Associations with custom columnNames Sep 9, 2016
@pberba
Copy link
Author

pberba commented Sep 9, 2016

ok, fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants