This repository has been archived by the owner on May 26, 2023. It is now read-only.
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.
In some cases, it could be useful to have attributes that are not persisted to the DB. For instance, user models could have a virtual
password
property that is bcrypt'ed in a beforeSave handler, and stored in a column calledencrypted_password
.We are using virtual attribute support together with onHydrate callbacks to normalize our data model as we migrate data to different tables, which allows us to keep model property access consistent, even across data migrations.
These changes allow you to define virtual properties in your schema, which makes sense if you think of the schema as the DomainObject schema, and not the mysql schema. So the property definitions become:
If you are interested in this pull, I'll add tests.