sequelize icon indicating copy to clipboard operation
sequelize copied to clipboard

Documentation for BelongsToSetAssociationMixin outdated?

Open aendra-rininsland opened this issue 9 years ago • 1 comments

I tried using this syntax earlier today from here and it wasn't working:


interface UserInstance extends Sequelize.Instance<UserInstance, UserAttributes>, UserAttributes {
   // getRole...
   setRole: Sequelize.BelongsToSetAssociationMixin<RoleInstance, RoleId>;
   // createRole...
}

TypeScript (2.0.3 btw) complains that Generic type 'Instance<TAttributes>' requires 1 type argument(s). Replacing it with Sequelize.Instance<UserAttributes> seems to work.

Further, RoleId isn't described in the documentation; what is that value from? I supplied the type keyword for what that field is in my RoleAttributes interface and it seems to have worked.

Apologies if this is all working as it should and I'm just missing something obvious!

aendra-rininsland avatar Dec 22 '16 00:12 aendra-rininsland

Yep, the docblocks are very outdated. The README and tests should be up to date though. Feel free to do a PR.

felixfbecker avatar Dec 22 '16 08:12 felixfbecker