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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add __parent reference to embedded models #1834
Conversation
848a73b
to
b4c093c
Compare
Here are the test failures I am observing in the PostgreSQL, Cloudant and MongoDB connectors:
|
@slnode test please |
Trying to drop support for Node.js 8.x in the PostgreSQL connector to see if it makes any difference: loopbackio/loopback-connector-postgresql#431 |
Hmm, by removing support for Node.js 8.x from the PostgreSQL connector I have effectively disabled dowstream testing :( Let's wait for @rmg to update our downstream builders to use Node.js 12. |
@slnode test please |
013c279
to
5dc158c
Compare
test/basic-querying.test.js
Outdated
@@ -962,20 +962,24 @@ describe('basic-querying', function() { | |||
|
|||
describe('check __parent relationship in embedded models', () => { | |||
createTestSetupForParentRef(() => User.modelBuilder); | |||
// eslint-disable-next-line mocha/no-exclusive-tests |
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.
Forgotten comment, will remove.
Looks like 5dc158c fixed downstream tests, yay 馃暫 I am going to clean up the commit history to run the final CI build and prepare this PR for landing. |
Add a new hidden property `__parent` that's automatically set on all instances of embedded models. For backwards compatibility, this feature is not enabled by default. You can turn it on by adding the following line to `server/server.js` file: app.registry.modelBuilder.settings.parentRef = true;
5dc158c
to
095ddd6
Compare
@bajtos kudos for finding the problem! Changes are good as far as I am concerned! Feel free to move on with the PR! |
This pull request supersedes #1787 by @mitsos1os. I cleaned up the commit history and also tweaked code formatting (white space) in few places.
Add a new hidden property
__parent
that's automatically set on all instances of embedded models.For backwards compatibility, this feature is not enabled by default. You can turn it on by adding the following line to
server/server.js
file:Resolve #1787
Checklist
馃憠 Read and sign the CLA (Contributor License Agreement) 馃憟
npm test
passes on your machine