Closed tute closed 9 years ago
Also, adding that tests make others flap. Tests run interleaved?
This test is almost a clone of the previous one, should we remove the first one?
This issue is also giving me a hard time :)
Applying your commented patch above seemed to do the trick for the relationships but causes exceptions in other instances. For example:
value = new Date();
typeof(value); //object
value.toArray(); // TypeError: undefined is not a function
According to some research checking for isArray
is a bit ugly. I've tried changing your code to:
var key, value, _ref;
_ref = record._data;
for (key in _ref) {
value = _ref[key];
if (typeof value === 'object' && (value instanceof Array)) { // <-- this line changed
serialized[key] = value.toArray();
}
}
This fixes the TypeError
, however the relationships still aren't persisted (tested with localForage). Any further thoughts on this issue?
@will-hart @tute I fixed this on ca9797661e253842389d04056242aff3ea22eda9 :grin:
Related issue: https://github.com/kurko/ember-sync/issues/15#issuecomment-48251695.
Can't get to meaningful error messages yet, it stalls with: