genkgo / ember-localforage-adapter

Offline usage for Ember Data, based on localstorage adapter, but now uses Mozilla's localforage as data source
Other
133 stars 26 forks source link

Losing Date type data in EmbeddedRecords #59

Closed acerov closed 5 years ago

acerov commented 8 years ago

Hi people,

I am struggling with these for a day, will go straight to the point.

I have model with hasMany relationship, "child" model have paymentDate: DS.attr('date') attribute.

When saving to IndexedDB localforage I lose "paymentDate" data (it is null) except for last parent record saved. Last parent record saved is always ok (all "child" records are ok), but every other parent record lose "paymentDate" data in every "child" record. Ember inspector shows that "store" did not lose anything, all records have "paymentDate" data.

What is interesting record that was previously persisted ok, when I save new one, loses data, just last record is ok.

If I change attribute from paymentDate: DS.attr('date') to paymentDate: DS.attr('string') everything is persisted ok.

I tried to dive in source but got lost, don't know what and where is going on. I am using "ember-113-compat" branch, browser is up to date Chrome.

Thnx for reading and eventually testing it :)