Skip to content

Commit

Permalink
fix: subModel的clazz修饰器有问题
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed Nov 30, 2023
1 parent 7141a93 commit 0578912
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function subModel(options: SchemaOptions & {name?: string} = {}): ClassDe
meta.name = options.name
}
meta.options = options
meta.clazz = target.prototype
meta.clazz = target
}
}

Expand Down
1 change: 1 addition & 0 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class User {
@array(Address) public addresses!: Address[]
@prop() public account!: Account
@ref(() => SomeStringIdModel, String) public someStringIdModel!: Ref<SomeStringIdModel>
@prop() type!: string

@statics()
public static async findByName(this: RichModelType<typeof User>, name: string): Promise<User | null> {
Expand Down

0 comments on commit 0578912

Please sign in to comment.