lucian1900/Backbone.dualStorage — pull request #37 by maxpeterson (2013-05-29 17:26:17+00:00)
Title: Collection fetch error when the remote servers response does not include ids.

The remote API I am using does not include an `id` in the response data. This caused an error in the `Store.create` method when it attempted to call `model.set(...)`.

In this case (collection fetch / sync read) the `Store.create` method was called by localsync for each raw item in the remote servers response. `Store.create` seemed to be expecting a Backbone.Model object however it was provided a raw object (e.g. `{'title': 'My instance', 'fu': 'bar', ...}`).

This is my first use of the library so I am not sure if this is expected or a consequence of the *stack* I am using, but it seemed like `Store.create` would always be called with a raw object (during a collection fetch).

In addition it looked like the `Store.create` method would overwrite the models `idAttribute` with a generated id in the case that the `id` was not set, so I also added a condition to attempt to resolve `id` based on `idAttribute` before generating an `id`.