Open jamesdixon opened 7 years ago
@workmanw any thoughts on this one? Just ran into it again
Do you think you could write either a failing test or an ember-twiddle for this? I could make some time to take a look.
@jamesdixon I had this issue as well because data passed to fragment-array transformation was null
or undefined
. I've made extension to this and now all is fine.
import FragmentArrayTransform from 'ember-data-model-fragments/transforms/fragment-array';
import { isNone } from 'ember-utils';
export default FragmentArrayTransform.extend({
deserialize(serialized) {
if (isNone(serialized)) {
return this._super([]);
}
return this._super(serialized);
}
});
@workmanw I think it should be default behaviour. Or at least use strict equality(===) to check for null. Now even undefined
value will results to null so fragment cannot use default value for records from server.
@kolybasov where did you end up adding this extension?
@jamesdixon /app/transforms/fragment-array.js
.
Hello,
I'm running into an issue where an attribute on my model that is set to a
fragmentArray
is always set tonull
by default rather than an empty array (default according to docs). I've tried setting in multiple ways, with no luck:Here's the
rate
fragment I'm referencing:I'm running ED 2.11 and EDMF 2.11.
Thanks in advance!