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

Commit 472dda1d by loulin

Update associations.md

To support an alias for HasMany, the alias name must be specified in include, otherwise it will throw error like `unhandled rejection Error: Categories is not associated to Product!`
1 parent 8b28cbb3
Showing with 4 additions and 1 deletions
...@@ -813,7 +813,10 @@ Product.create({ ...@@ -813,7 +813,10 @@ Product.create({
{id: 2, name: 'Beta'} {id: 2, name: 'Beta'}
] ]
}, { }, {
include: [ Categories ] include: [{
model: Categories,
as: 'categories'
}]
}) })
``` ```
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!