Skip to content

Commit

Permalink
[CLEANUP BUGFIX] cleanup modelFor and modelFactoryFor codepaths
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Apr 22, 2018
1 parent 87be9b7 commit 4270054
Show file tree
Hide file tree
Showing 10 changed files with 179 additions and 132 deletions.
4 changes: 2 additions & 2 deletions addon/-private/system/model/internal-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default class InternalModel {
}

get modelClass() {
return this._modelClass || (this._modelClass = this.store._modelFor(this.modelName));
return this._modelClass || (this._modelClass = this.store.modelFor(this.modelName));
}

get type() {
Expand Down Expand Up @@ -391,7 +391,7 @@ export default class InternalModel {
createOptions.container = this.store.container;
}

this._record = this.store.modelFactoryFor(this.modelName).create(createOptions);
this._record = this.store._modelFactoryFor(this.modelName).create(createOptions);

this._triggerDeferredTriggers();
heimdall.stop(token);
Expand Down
2 changes: 1 addition & 1 deletion addon/-private/system/record-arrays/record-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default ArrayProxy.extend(Evented, {
if (!this.modelName) {
return null;
}
return this.store._modelFor(this.modelName);
return this.store.modelFor(this.modelName);
}).readOnly(),

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default class RelationshipPayloadsManager {
@method
*/
unload(modelName, id) {
let modelClass = this._store._modelFor(modelName);
let modelClass = this._store.modelFor(modelName);
let relationshipsByName = get(modelClass, 'relationshipsByName');
relationshipsByName.forEach((_, relationshipName) => {
let relationshipPayloads = this._getRelationshipPayloads(modelName, relationshipName, false);
Expand Down Expand Up @@ -189,7 +189,7 @@ export default class RelationshipPayloadsManager {
return cached;
}

let modelClass = store._modelFor(modelName);
let modelClass = store.modelFor(modelName);
let relationshipsByName = get(modelClass, 'relationshipsByName');

// CASE: We don't have a relationship at all
Expand Down
Loading

0 comments on commit 4270054

Please sign in to comment.