Skip to content

Commit

Permalink
clarify types
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Dec 6, 2019
1 parent b8d1496 commit ba7c14c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/store/addon/-private/system/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export default class Snapshot {
if (CUSTOM_MODEL_CLASS) {
attrs.forEach(keyName => {
if (schemaIsDSModel(this.type)) {
// if the schema is for a DSModel then the instance is too
attributes[keyName] = get(record as DSModel, keyName);
} else {
attributes[keyName] = recordDataFor(this._internalModel).getAttr(keyName);
Expand Down Expand Up @@ -457,6 +458,7 @@ export default class Snapshot {
callback.call(binding, key, attrDefs[key]);
});
} else {
// in the non CUSTOM_MODEL_CLASS world we only have DSModel instances
(this.record as DSModel).eachAttribute(callback, binding);
}
}
Expand Down Expand Up @@ -484,6 +486,7 @@ export default class Snapshot {
callback.call(binding, key, relationshipDefs[key]);
});
} else {
// in the non CUSTOM_MODEL_CLASS world we only have DSModel instances
(this.record as DSModel).eachRelationship(callback, binding);
}
}
Expand Down

0 comments on commit ba7c14c

Please sign in to comment.