Skip to content
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

Usage with Discrimators #98

Open
Kacper0105 opened this issue Apr 24, 2021 · 1 comment
Open

Usage with Discrimators #98

Kacper0105 opened this issue Apr 24, 2021 · 1 comment

Comments

@Kacper0105
Copy link

Hello!
It is not very clear to me how should I use this library with discriminators.
There is a User model in my codebase and a BusinessUser, which is a discriminator based on User model.
After applying the plugin to userSchema, User model is encrypted properly. However, the outcome of saving BusinessUser is following: original fields from userSchema are encoded, however businessUserSchema fields are not.

This behavior is understandable, as plugin is applied to userSchema and has no knowledge of businessUserSchema fields, however I believe that there is a way I can make this library work with discriminators.

@joegoldbeck
Copy link
Owner

Hi @Kacper0105 thank you for logging this issue!

Discriminators are not something that this library has explicit support for. If there's a fairly simple change that would add this support, I'd be happy to review a tested PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants