-
Notifications
You must be signed in to change notification settings - Fork 76
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
hasMany relationship not saved unless serializer present #160
Comments
I like to merge #159 that removes the need to store the hasmany side. If the hasmany is stored and synced by multiple users first strange errors occur. @nolanlawson has to find time to merge PR pouchdb-community/relational-pouch#61 first. @dale42 perhaps you can try if PR #159 works for you. |
I am trying this out and it seems like with this change I am able to get things to save, but I have to call save on the child object? And if I call save on the parent object it does not cascade down? in my add child action I create a new child record and give it the parent then save it and it is added to the parents document ... but if I call save on the parent instead it puts a null into the child array I also would expect that after I get the child added to the parent and then change a property on the child I should be able to call save on the parent record and it would save the changes but it does not |
@chrisortman, I don't know if you are using the new Look at https://guides.emberjs.com/v2.10.0/models/relationships/#toc_creating-records for an example of the normal ember-data way.
But I believe that the |
@chrisortman @dale42 Did you get it working with the |
I encountered what I believe is the same problem as @asuraphel in #143 (Bidirectional hasMany relationship has empty list on the many side).
The hasMany relationship was not being saved into PouchDB, though the updates were being displayed properly in the templates until the browser was refreshed or restarted. Adding a serializer resolved my problem, as it did @asuraphel's.
I'm filing this issue because I think there is still an outstanding question:
In case this an issue caused by configuration differences, I've made my test app available so you can see my configuration: https://github.com/dale42/pouch-serializer-demo And also, perhaps, in case I did something else completely left-field :)
If this is simply an undocumented requirement then the README.md should be updated.
Issue #117 (Install serialiser by default?) may also be related.
The text was updated successfully, but these errors were encountered: