Skip to content

Commit

Permalink
Merge pull request #5593 from kennethlarsen/feature/5537-backport-to-3.2
Browse files Browse the repository at this point in the history
[BUGFIX Backport] fix createRecord re-fetch
  • Loading branch information
runspired authored Aug 27, 2018
2 parents b9e3638 + b39e11a commit 0b61f20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ branches:
- master
- beta
- release
# prior release branches
- /^release-\d+-\d+/
# npm version tags
- /^v\d+\.\d+\.\d+/

Expand Down
12 changes: 6 additions & 6 deletions addon/-private/system/relationships/state/relationship.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ export default class Relationship {
this.store._updateRelationshipState(this);
}

updateLink(link, initial) {
updateLink(link) {
heimdall.increment(updateLink);
warn(
`You pushed a record of type '${this.internalModel.modelName}' with a relationship '${
Expand All @@ -528,10 +528,6 @@ export default class Relationship {
this.link = link;
this.fetchPromise = null;
this.setRelationshipIsStale(true);

if (!initial) {
this.internalModel.notifyPropertyChange(this.key);
}
}

reload() {
Expand Down Expand Up @@ -693,7 +689,7 @@ export default class Relationship {
let relatedLink = _normalizeLink(payload.links.related);
if (relatedLink && relatedLink.href && relatedLink.href !== this.link) {
hasLink = true;
this.updateLink(relatedLink.href, initial);
this.updateLink(relatedLink.href);
}
}

Expand Down Expand Up @@ -721,6 +717,10 @@ export default class Relationship {
this.setRelationshipIsEmpty(relationshipIsEmpty);
} else if (hasLink) {
this.setRelationshipIsStale(true);

if (!initial) {
this.internalModel.notifyPropertyChange(this.key);
}
}
}

Expand Down

0 comments on commit 0b61f20

Please sign in to comment.