Open lreyessandoval opened 4 years ago
@lreyessandoval Thanks for posting! We'll take a look as soon as possible.
In the mean time, there are a few ways you can help speed things along:
Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly.
For help with questions about Sails, click here.
Hey, @lreyessandoval! I believe the functionality you're looking for isn't supported in Sails v1. Per the upgrade guide:
The .create(), .update() and .add() model methods no longer support creating a new “child” record to link immediately to a new or existing parent. For example, given a User model with a singular association to an Animal model through an attribute called pet, it is not possible to set pet to a dictionary representing values for a brand new Animal (aka a “nested create”). Instead, create the new Animal first and use its primary key to set pet when creating the new User.
Thanks, I will look for a workarround for this case ...
Is there a date to release this functionality in a next release?
@lreyessandoval—from what I understand, this functionality was supported in older (pre-v1) versions of Sails. I don't think that there are any plans to revive it for future versions.
Node version: v12.13.0 Sails version (sails): 1.2.3 DB adapter & version : sails-mysql@5.7.23-cll-lve
I have a model User (Parent):
And Model Pet (Child):
Find/FindAll populating works fine, but when I try to create a header (User) and details (Pet) an error appears.
This is the error that returns: