-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(model): add mergePlugins
option to discriminator
#12613
Conversation
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.
A minor comment. Also we'll have to merge this into 6.8, this is a new option
lib/helpers/model/discriminator.js
Outdated
@@ -34,7 +35,7 @@ module.exports = function discriminator(model, name, schema, tiedValue, applyPlu | |||
|
|||
if (applyPlugins) { | |||
const applyPluginsToDiscriminators = get(model.base, | |||
'options.applyPluginsToDiscriminators', false) || !mergeHooks; | |||
'options.applyPluginsToDiscriminators', false) || !mergeHooks || !mergePlugins; |
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'm not a fan of how mergePlugins
applies here. Seems a little strange that mergePlugins
also effectively disables applyPlugins
.
Maybe instead we reuse applyPlugins
instead of adding a new option?
ab5fc94
to
bdfea16
Compare
used applyPlugins option in discriminator helper instead of creating new option mergePlugins
bdfea16
to
1ff2654
Compare
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.
Thanks 👍
Fix #12604