website
website copied to clipboard
docs: fix bidirectional association examples in v7 upgrade guide
Fixed bidirectional examples that were inconsistent.
- The model
CountryandCountrieswas used. I updated all of the models in the example to use singular names. - Updated association aliases to be plural names
citizen->citizensas recommended for many-to-many associations - Fixed an error associating User to User (
User.belongsToMany(User, { foreignKey: 'user_id' });) instead of to Country as further explained in the example
Thanks for the work on v7, it's looking great. I'd be happy to make changes if I misunderstood the intent of the examples here.