mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
[Sequelize]: scope should be supported for all association types (#35420)
* [Sequelize]: Adding support for association scopes on all associations * [Sequelize]: Adding support for association scopes on all associations
This commit is contained in:
parent
81fc741f8d
commit
8dfd127a63
2
types/sequelize/index.d.ts
vendored
2
types/sequelize/index.d.ts
vendored
@ -18,6 +18,7 @@
|
||||
// Dima Smirnov <https://github.com/smff>
|
||||
// Duy Truong <https://github.com/truongkhanhduy95>
|
||||
// Emmanuel Gautier <https://github.com/emmanuelgautier>
|
||||
// Dan Rumney <https://github.com/dancrumb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@ -1273,6 +1274,7 @@ declare namespace sequelize {
|
||||
constraints?: boolean;
|
||||
foreignKeyConstraint?: boolean;
|
||||
|
||||
scope?: AssociationScope;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -136,6 +136,7 @@ User.hasMany( User, {
|
||||
foreignKey : 'parent',
|
||||
foreignKeyConstraint : true
|
||||
} );
|
||||
User.hasOne( Task, { foreignKey : 'userId', as : 'activeTasks', scope : { active : true } } );
|
||||
|
||||
User.belongsToMany( Task, { through : 'UserTasks' } );
|
||||
User.belongsToMany( User, { through : Task } );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user