kurko / ember-indexeddb-adapter

Ember Data IndexedDB Adapter
MIT License
43 stars 16 forks source link

Date attributes were set to null with findAll #18

Closed rsutphin closed 10 years ago

rsutphin commented 10 years ago

With the current version of the adapter, DS.attr('date') attributes are set to null when the records they are part of were found using findAll. Turns out that this was because the serializer's extractArray method was normalizing each record twice.

This PR includes tests for loading date attributes in both the single record and array cases. (Single records were already working, but didn't have a test here.) There's also a small change that was necessary to get the adapter's integration tests to run at all. However, as noted in #14, there are a bunch of other failures. AFAICT, this PR does not make any of them worse.

rsutphin commented 10 years ago

A similar (but not identical) problem affected loading dates in associations. They were being loaded without being deserialized, so they'd be Strings instead of actual Date objects. I've made a fix for that as part of this PR also (humanpractice/ember-indexeddb-adapter@0b1c73a). If you'd prefer that be a separate PR, I'm happy to split it out.

kurko commented 10 years ago

Sorry for the delay in responding. I'm traveling but I'll take a look this week.