While going through the sequelize docs, more specifically the documentations about associations, I see that the guide casually shows the reader methods such as setTasks()<
To get a listing of the added methods try:
const model = %yourSequelizeModel%
for (let assoc of Object.keys(model.associations)) {
for (let accessor of Object.keys(model.associations[assoc].accessors)) {
console.log(model.name + '.' + model.associations[assoc].accessors[accessor]+'()');
}
}
Credit goes to https://gist.github.com/Ivan-Feofanov/eefe489a2131f3ec43cfa3c7feb36490
To adjust the association names use "as" option:
Model.hasOne(models.series_promotions, { as: 'seriesPromotions' });
which changed the association method name from:
series.getSeries_promotion()
series.setSeries_promotion()
series.createSeries_promotion()
to
series.getSeriesPromotions()
series.setSeriesPromotions()
series.createSeriesPromotions()
based on the snippet above.