emberjs/data — pull request #1468 by tpitale (2013-10-22 04:05:22+00:00)
Title: Handle case of single object pushPayload

The standard response from ActiveModel::Serializers is acceptable for ember-data when responding to something like `GET /posts/1` from `store.find('post', 1)`. This will include a singular Post, and any associations, such as a set of comments.

If however, I wanted to use this same serializer to push a Post over Server-Sent Events or WebSockets, I would not currently be able to use `store.pushPayload`. While it would load the array of associated comments just fine, the actual object I care about, the single post, would be ignored.

This simple (if inelegant) change wraps the `payload[prop]` in a call to `Ember.makeArray`, so that even single objects will work inside the `map.call` when attempting to "normalize" the array.

Thank you for your time.