Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(sample-07): added unit tests #8044
test(sample-07): added unit tests #8044
Changes from 8 commits
6adcfa1
098e64c
c18bf44
e5db699
d764c29
621809b
9711141
26929c8
9421ff1
dd8e697
3ba2052
de8d95d
ae433f0
c6d271a
347562d
c3bf1e4
06fd145
b142da0
1110197
f373c41
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? (and how can we avoid making this change)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the directions in the documentation: https://docs.nestjs.com/techniques/database#models ,
by adding the models in
SequelizeModule.forRoot({...})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be required when
autoLoadModels
is set totrue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't want to be wrong, but in sequelize version 5, registering the model in
SequelizeModule.forRoot ({...})
was an alternative to extending the Model class, like this exampleexport class Post extends Model<Post> {.... }
.Now from version 6, under the hood of sequelize something seems to have changed, so as you said
autoLoadModels: true
automatically loads the Modules if set totrue
, similar to TypeORM, now I tried to removemodels:[]
and it seems to work.Maybe we should update the documents for this, what do you think?
Then I wanted to ask you but is the
models:[]
setting still useful to use? maybe you could remove it as a setting?