Skip to content

Commit

Permalink
get recordData via store.recordDataFor in identifier case
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer committed Oct 30, 2020
1 parent 316c9bf commit 84ea514
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 1 addition & 5 deletions packages/store/addon/-private/system/core-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2685,11 +2685,7 @@ abstract class CoreStore extends Service {
@param {Object} data
*/
_load(data: ExistingResourceObject) {
const resource: ResourceIdentifierObject = constructResource(
normalizeModelName(data.type),
ensureStringId(data.id),
coerceId(data.lid)
);
const resource = constructResource(normalizeModelName(data.type), ensureStringId(data.id), coerceId(data.lid));

let internalModel = internalModelFactoryFor(this).lookup(resource, data);

Expand Down
6 changes: 5 additions & 1 deletion packages/store/addon/-private/system/references/reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ abstract class Reference {
}

get recordData() {
return internalModelForReference(this)?._recordData;
if (RECORD_ARRAY_MANAGER_IDENTIFIERS) {
return this.store.recordDataFor(REFERENCE_CACHE.get(this) as StableRecordIdentifier, false);
} else {
return internalModelForReference(this)?._recordData;
}
}

public _resource(): ResourceIdentifier | JsonApiRelationship | void {}
Expand Down

0 comments on commit 84ea514

Please sign in to comment.