{"action":"closed","issue":{"url":"https://api.github.com/repos/emberjs/data/issues/3892","labels_url":"https://api.github.com/repos/emberjs/data/issues/3892/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/data/issues/3892/comments","events_url":"https://api.github.com/repos/emberjs/data/issues/3892/events","html_url":"https://github.com/emberjs/data/issues/3892","id":113663489,"number":3892,"title":"JSON API not serializing hasMany relationship ","user":{"login":"sescobb27","id":1157892,"avatar_url":"https://avatars.githubusercontent.com/u/1157892?v=3","gravatar_id":"","url":"https://api.github.com/users/sescobb27","html_url":"https://github.com/sescobb27","followers_url":"https://api.github.com/users/sescobb27/followers","following_url":"https://api.github.com/users/sescobb27/following{/other_user}","gists_url":"https://api.github.com/users/sescobb27/gists{/gist_id}","starred_url":"https://api.github.com/users/sescobb27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sescobb27/subscriptions","organizations_url":"https://api.github.com/users/sescobb27/orgs","repos_url":"https://api.github.com/users/sescobb27/repos","events_url":"https://api.github.com/users/sescobb27/events{/privacy}","received_events_url":"https://api.github.com/users/sescobb27/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-27T19:33:41Z","updated_at":"2015-11-04T13:38:51Z","closed_at":"2015-11-04T13:38:51Z","body":"Hi, we are upgrading to Ember 1.13 using Ember Data 1.13 and we have the following models\r\n\r\nmodels/order.js\r\n```js\r\nimport DS from 'ember-data';\r\n\r\nvar attr = DS.attr;\r\n\r\nexport default DS.Model.extend({\r\n  orderType: attr('string'),\r\n  plan: DS.belongsTo('plan', {\r\n    async: false\r\n  }),\r\n  details: DS.hasMany('order-detail', {\r\n    async: true,\r\n    inverse: 'order'\r\n  }),\r\n  customer: DS.belongsTo('customer', {\r\n    async: true,\r\n    inverse: 'orders'\r\n  })\r\n});\r\n```\r\n\r\nmodels/order-detail.js\r\n```js\r\nimport DS from 'ember-data';\r\n\r\nvar attr = DS.attr;\r\n\r\nexport default DS.Model.extend({\r\n  sku: attr('string'),\r\n  quantity: attr('number'),\r\n  price: attr('number'),\r\n  total: Ember.computed('quantity', 'price', function () {\r\n    return this.get('price') * this.get('quantity');\r\n  }),\r\n  size: attr('string'),\r\n  product: DS.belongsTo('product', {\r\n    async: true\r\n  }),\r\n  order: DS.belongsTo('order', {\r\n    async: true,\r\n    inverse: 'details'\r\n  })\r\n});\r\n```\r\nwhen we try to create an order detail `orderDetail.save()` it makes a POST request with the following payload\r\n```json\r\n{\r\n  \"data\":{\r\n  \"attributes\":{\r\n    \"sku\":\"FC-fey-11-00\",\r\n     \"quantity\":1,\r\n     \"price\":4000,\r\n    \"size\":\"00\"\r\n  },\r\n  \"relationships\":{\r\n    \"product\":{\r\n      \"data\":{\r\n        \"type\":\"products\",\r\n        \"id\":\"1\"\r\n      }\r\n    },\r\n    \"order\":{\r\n      \"data\":{\r\n        \"type\":\"orders\",\r\n        \"id\":\"1445972727491\"\r\n      }\r\n    }\r\n  },\r\n  \"type\":\"order-details\"\r\n  }\r\n}\r\n```\r\n\r\nbut if we try to save an order `order.save()` it omits `details` key in relationships\r\n```json\r\n{\r\n  \"data\":{\r\n  \"attributes\":{\r\n    \"order-type\":\"subscription\",\r\n    \"production-state\":\"0\",\r\n    \"payment-state\":\"0\",\r\n    \"shipment-state\":\"0\",\r\n    \"created-at\":null,\r\n    \"ship-date\":null,\r\n    \"season\":\"FA15\"\r\n  },\r\n  \"relationships\":{\r\n    \"plan\":{\r\n      \"data\":{\r\n        \"type\":\"plans\",\r\n        \"id\":\"1-shirt\"\r\n      }\r\n    },\r\n    \"coupon\":{\"data\":null},\r\n    \"address\":{\"data\":null},\r\n    \"customer\":{\"data\":null}\r\n  },\r\n  \"type\":\"orders\"\r\n  }\r\n}\r\n```\r\n\r\nwhat are we doing wrong? how could we achieve this?\r\nthanks."}}