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

Make m:n nested updates API consistent with 1:1 and 1:m #5531

Closed
dmarcelino opened this issue Apr 23, 2015 · 8 comments
Closed

Make m:n nested updates API consistent with 1:1 and 1:m #5531

dmarcelino opened this issue Apr 23, 2015 · 8 comments

Comments

@dmarcelino
Copy link
Member

Nested updates in the form of User.update({id: 1 }, { posts: [ { id: 1, title: 'Test post - updated' }] }) work for 1:1 and 1:m associations but breaks for m:n associations. The API for this should be consistent between association types.

PR balderdashy/waterline-adapter-tests#51 provides the failing tests for this feature.

#292 - Add .add(), .remove(), .save() support for 1-1 and 1-* associations complements this by making the API across 1:1, 1:m and m:n the same for all operations.

@devinivy
Copy link

I surprised this is a bug, honestly. Could've sworn this worked! What occurs instead of a successful update? Is it possibly updated in the database, but not reflected in the results waterline returns?

@dmarcelino
Copy link
Member Author

The child values are left untouched but the association between parent and child is set correctly.

The tests do a .find() after the update (https://github.com/balderdashy/waterline-adapter-tests/pull/51/files#diff-4a8c2e665523976121614a83468c4a69L176) so I don't think it was updated in the DB.

@devinivy
Copy link

@dmarcelino
Copy link
Member Author

@devinivy you are like a travel guide to waterline core code! 😃

@sailsbot
Copy link

Thanks for posting, @dmarcelino. I'm a repo bot-- nice to meet you!

It has been 60 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message. On the other hand, if you are still waiting on a patch, please:

  • review our contribution guide to make sure this submission meets our criteria (only verified bugs with documented features, please; no questions, commentary, or bug reports about undocumented features or unofficial plugins)
  • create a new issue with the latest information, including updated version details with error messages, failing tests, and a link back to the original issue. This allows GitHub to automatically create a back-reference for future visitors arriving from search engines.

Thanks so much for your help!

@devinivy
Copy link

This is the sole blocker for balderdashy/waterline-adapter-tests#51

@devinivy devinivy reopened this Sep 26, 2015
@sailsbot
Copy link

Thanks for posting, @dmarcelino. I'm a repo bot-- nice to meet you!

It has been 30 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message. On the other hand, if you are still waiting on a patch, please:

  • review our contribution guide to make sure this submission meets our criteria (only verified bugs with documented features, please; no questions, commentary, or bug reports about undocumented features or unofficial plugins)
  • create a new issue with the latest information, including updated version details with error messages, failing tests, and a link back to the original issue. This allows GitHub to automatically create a back-reference for future visitors arriving from search engines.

Thanks so much for your help!

@devinivy devinivy reopened this Oct 27, 2015
@sailsbot
Copy link

Thanks for posting, @dmarcelino. I'm a repo bot-- nice to meet you!

It has been 30 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message. On the other hand, if you are still waiting on a patch, please:

  • review our contribution guide to make sure this submission meets our criteria (only verified bugs with documented features, please; no questions, commentary, or bug reports about undocumented features or unofficial plugins)
  • create a new issue with the latest information, including updated version details with error messages, failing tests, and a link back to the original issue. This allows GitHub to automatically create a back-reference for future visitors arriving from search engines.

Thanks so much for your help!

@raqem raqem transferred this issue from balderdashy/waterline May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants