Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Ember Data 1.0 no longer does any payload normalization by default. The <code>key</code> configuration for <code>DS.belongsTo</code> has been removed as well so you will have to implement a custom serializer.</p> <p><code>normalizeId</code> is an internal serializer function used for converting primary keys to always be available at <code>id</code>. You shouldn't override this.</p> <p>Instead, you can override the <code>keyForRelationship</code> method which is provided for this purpose.</p> <p>You could use something like the following:</p> <pre><code>App.ApplicationSerializer = DS.RESTSerializer.extend({ keyForRelationship: function(rel, kind) { if (kind === 'belongsTo') { var underscored = rel.underscore(); return underscored + "_id"; } else { var singular = rel.singularize(); var underscored = singular.underscore(); return underscored + "_ids"; } } }); </code></pre> <p>Note: I've also renamed the serializer to <code>App.ApplicationSerializer</code> so that it will be used as the default serializer for your application.</p> <p>Finally, if you haven't already found it, please take a look at the transition notes here: <a href="https://github.com/emberjs/data/blob/master/TRANSITION.md">https://github.com/emberjs/data/blob/master/TRANSITION.md</a></p> <p>If you read through the transition document shortly after the initial 1.0.0.beta.1 release I would recommend taking a look again as there have been a number of additions, particularly regarding serialization.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload