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

Commit 2c06293c by Mirko Jotic Committed by Sushant

fix(types): add Paranoid to Includeable (#10804)

1 parent 4f71cb2d
Showing with 10 additions and 3 deletions
...@@ -340,7 +340,7 @@ export type Includeable = typeof Model | Association | IncludeOptions | { all: t ...@@ -340,7 +340,7 @@ export type Includeable = typeof Model | Association | IncludeOptions | { all: t
/** /**
* Complex include options * Complex include options
*/ */
export interface IncludeOptions extends Filterable, Projectable { export interface IncludeOptions extends Filterable, Projectable, Paranoid {
/** /**
* The model you want to eagerly load * The model you want to eagerly load
*/ */
......
...@@ -9,8 +9,16 @@ class MyModel extends Model { ...@@ -9,8 +9,16 @@ class MyModel extends Model {
} }
} }
class OtherModel extends Model {}
const assoc: Association = MyModel.associations.other; const assoc: Association = MyModel.associations.other;
MyModel.findOne({
include: [
{ model: OtherModel, paranoid: true }
]
});
const sequelize = new Sequelize('mysql://user:user@localhost:3306/mydb'); const sequelize = new Sequelize('mysql://user:user@localhost:3306/mydb');
MyModel.init({}, { MyModel.init({}, {
...@@ -23,4 +31,4 @@ MyModel.init({}, { ...@@ -23,4 +31,4 @@ MyModel.init({}, {
], ],
sequelize, sequelize,
tableName: 'my_model' tableName: 'my_model'
}); });
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!