website
website copied to clipboard
addProfile is not function on many to many relationship
Bug Description
I am copying and pasting the following from here to set up a one to many relationship, it says .addProfile is not a function, after copying and pasting the code with the table definitions already set up in the readme. This also goes if I switch the name "Profile" to the child element, such as addCart or addTag, etc.
When you compile the code, it says ".addProfile" is not a function. I'm assuming sequelize dynamically creates this method but that doesn't seem to happen
What do you expect to happen?
For it to not give an error
What is actually happening?
Gives an error
You can check what methods are available on your model by calling console.dir(User.prototype) after having called User.belongsToMany(Profile)