This repository has been archived by the owner on Jun 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
Support inheritance from abstractModel (old: staticMethod not giving model as this) #28
Labels
Comments
Hello I think you haven't included some other Models' code. Can you please extend your example? Right now its hard to tell what is wrong. |
Theres really not much to the other models import AbstractModel from "./AbstractModel"
export default class User extends AbstractModel {
}
let user: User = await UserModel.findOneByIdentifier('some identifier here'); |
I might be missing something, but it actually seems like inheritance is not supported |
Hi @aequasi |
vinczedani
changed the title
staticMethod not giving model as this
Support inheritance from abstractModel (old: staticMethod not giving model as this)
Sep 20, 2017
Has there been any update to creating this enhancement? |
hasezoey
referenced
this issue
in typegoose/typegoose
Aug 7, 2019
- use schema.loadClass() instead of self-handling it - breaking many things - adding docs for virtual-populate - deprecating method decorators - deprecating setModelForClass - moving _buildSchema to its own file - adding error tests - adding more errors - rebuilding how schema generation works - adding more docs to VirtualOptions - adding "count" to VirtualOptions fixes szokodiakos#48 fixes szokodiakos#28 fixes szokodiakos#246 fixes szokodiakos#182
this should work in v6.0.0 @Ben305 this can be closed |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Using the following code:
this
is always an instance of the model, instead of the model type, so i can't callfindOne
.Feel like im missing something...
The text was updated successfully, but these errors were encountered: