-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
store.createRecord + record.save do not resolve hasMany-Relationships #1497
Comments
Based on the jsbin and talking on IRC I would say not a bug. The list of properties passed to |
Well, i still would call this a bug (at least an important enhancement), because behavior is not consistent here... there is no way to create a record with relationships, without manually passing all the relationship-properties in...
|
|
@FeipingHunag The problem here is not that the ids are not being serialized, but rather that createRecord doesn't accept relationships. I wouldn't expect it to accept ids in either case, but I feel like it should be possible to do
|
Not sure, let me test |
Hasn't been fixed yet, but should be simple. We just need to make https://github.com/emberjs/data/blob/master/packages/ember-data/lib/system/store.js#L271 smarter @sly7-7 have time to try? |
allowing to pass an has many relationship on create record. Fixes #1497
I tried to use store.createRecord for persisting hasMany-relationships, but they are not resolved in store.createRecord (store.push works correctly).
Here is a sample. Beware: There is no open REST api on jsbin, so requests are just "simulated". Open Firebug network protocol and look at "request payload":
http://jsbin.com/OJOJoFE/1/edit?html,js,output
Example code snippet:
The text was updated successfully, but these errors were encountered: