ember.js - ember-data: sideloading with v12 -


i had app ember-data v.11, working. updating @ ember-data 12 broke relation. stated here have these models:

app.transportdocument = ds.model.extend   number: ds.attr 'string'   transportdocumentrows: ds.hasmany('app.transportdocumentrow')  app.transportdocumentrow = ds.model.extend   productname: ds.attr 'string'   quantity: ds.attr 'string'   measure: ds.attr 'string'   transport_document: ds.belongsto('app.transportdocument') 

and return json:

{   transport_document:   {     number: 1     transport_document_rows: [602, 601, 3, 2, 1]   },   transportdocumentrows:    [     {       id:602,        transport_document_id:1,        product_name:dfsds,        quantity:1,       …     },     …   ] } 

my app seeing transport document attributes, ignoring rows attributes.

i tried camelize, tableize, put rows directly inside transport document. nothing seems work. how jsons like?

thank you

when migrating 1 revision another, check breaking_changes.md file

https://github.com/emberjs/data/blob/master/breaking_changes.md

it explains json needs this:

{   transport_document:   {     number: 1     transport_document_row_ids: [602, 601, 3, 2, 1]   },   transport_document_rows:    [     {       id:602,        transport_document_id:1,        product_name:dfsds,        quantity:1,       …     },     …   ] } 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -