Skip to content

Commit

Permalink
[BUGFIX] ensure that the belongsTo proxy for async relationships upda…
Browse files Browse the repository at this point in the history
…tes content when new content is explicitly null
  • Loading branch information
runspired committed Apr 30, 2018
1 parent 741fe77 commit ddf5e95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addon/-private/system/relationships/state/belongs-to.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export default class BelongsToRelationship extends Relationship {

_updateLoadingPromise(promise, content) {
if (this._loadingPromise) {
if (content) {
if (content !== undefined) {
this._loadingPromise.set('content', content)
}
this._loadingPromise.set('promise', promise)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/relationships/belongs-to-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module("integration/relationship/belongs_to Belongs-To Relationships", {
test("returning a null relationship from payload sets the relationship to null on both sides", function(assert) {
env.registry.register('model:app', DS.Model.extend({
name: attr('string'),
team: belongsTo('team', { async: true }),
team: belongsTo('team', { async: true })
}));
env.registry.register('model:team', DS.Model.extend({
apps: hasMany('app', {async: true})
Expand Down

0 comments on commit ddf5e95

Please sign in to comment.