Skip to content

Commit

Permalink
Rename relationship.relation to removeInverseRelationships
Browse files Browse the repository at this point in the history
  • Loading branch information
sduquej committed Mar 28, 2017
1 parent 3509c58 commit a9f91de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions addon/-private/system/model/internal-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -875,24 +875,24 @@ export default class InternalModel {
if (this._relationships.has(name)) {
let rel = this._relationships.get(name);
rel.clear();
rel.destroy();
rel.removeInverseRelationships();
}
});
Object.keys(this._implicitRelationships).forEach((key) => {
this._implicitRelationships[key].clear();
this._implicitRelationships[key].destroy();
this._implicitRelationships[key].removeInverseRelationships();
});
}

destroyRelationships() {
this.eachRelationship((name, relationship) => {
if (this._relationships.has(name)) {
let rel = this._relationships.get(name);
rel.destroy();
rel.removeInverseRelationships();
}
});
Object.keys(this._implicitRelationships).forEach((key) => {
this._implicitRelationships[key].destroy();
this._implicitRelationships[key].removeInverseRelationships();
});
}

Expand Down
4 changes: 2 additions & 2 deletions addon/-private/system/relationships/state/has-many.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default class ManyRelationship extends Relationship {
return this._manyArray;
}

destroy() {
super.destroy();
removeInverseRelationships() {
super.removeInverseRelationships();
if (this._manyArray) {
this._manyArray.destroy();
this._manyArray = null;
Expand Down
2 changes: 1 addition & 1 deletion addon/-private/system/relationships/state/relationship.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class Relationship {
return this.internalModel.modelName;
}

destroy() {
removeInverseRelationships() {
if (!this.inverseKey) { return; }

let allMembers =
Expand Down

0 comments on commit a9f91de

Please sign in to comment.