emberjs/data — pull request #727 by dgeb (2013-02-12 07:43:29+00:00)
Title: Introduce a custom `keyForHasMany()` for `DS.RESTSerializer`.

As discussed by @leepfrog in #710, `DS.RESTSerializer` is currently inconsistent with the data served up by active_model_serializers as of [this commit](https://github.com/rails-api/active_model_serializers/commit/3b1d2faf51b16446e1df26bc7d1b620741936da3). As the person responsible, I thought I should bring some consistency to AMS and ember-data, especially since I'm preparing a talk about that very topic ;)

This change introduces `keyForHasMany()` for `DS.RESTSerializer`, which returns the singularized key appended with `_ids`. It uses the same plurals hash on the serializer to determine singular versions of keys. This brings consistency to singularization and pluralization logic, and accounts for cases in which the key does not match the model name (for instance, consider `authors: DS.hasMany('App.User')`). In other words, there's a good reason to have a `singularize()` method instead of just relying on the model class.

//cc @wycats @tomdale