Repository navigation
feat: add isModelStatic, isSameInitialModel - #14360
Merged
Merged
Conversation
8 of 15 tasks
WikiRik
reviewed
Apr 11, 2022
WikiRik
left a comment
Member
There was a problem hiding this comment.
Nice utility function to add. Do have a few remarks
Co-authored-by: Rik Smale <[email protected]>
WikiRik
requested changes
Apr 11, 2022
WikiRik
left a comment
Member
There was a problem hiding this comment.
Final remark and then we're good to go
Co-authored-by: Rik Smale <[email protected]>
WikiRik
approved these changes
Apr 11, 2022
Contributor
|
🎉 This PR is included in version 7.0.0-alpha.11 🎉 The release is available on: Your semantic-release bot 📦🚀 |
vanthome
pushed a commit
to vanthome/sequelize
that referenced
this pull request
Jun 12, 2022
* feat: add isModelStatic, isSameInitialModel * docs: rework isSameInitialModel docs * Update test/unit/utils/model-utils.test.ts Co-authored-by: Rik Smale <[email protected]> * Update test/unit/utils/model-utils.test.ts Co-authored-by: Rik Smale <[email protected]> Co-authored-by: Rik Smale <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request Checklist
yarn testoryarn test-DIALECTpass with this change (including linting)?Description Of Change
This PR adds two new utility methods:
isModelStatic: returns true if the value is a subclass (not instance) of modelisSameInitialModel: returns true if two models are variants of the same modelBoth were initially created for #14280, but this PR also refactors the existing codebase to use them where it makes sense