Fix: unload record with relationships #567

Merged
merged 1 commit into from Apr 6, 2013

6 participants

@ppcano
  • calling clearRelationships before changing record state,
    otherwise fails because properties try to update removed
    relationships

  • Transaction commit failed when an unloaded record was in the
    transaction.bucketForType.updated array. Using recordIsMoving fixed
    this issue

@ppcano ppcano Fix: unload record with relationships
- calling `clearRelationships` before changing record state,
  otherwise it fails, because properties try to update removed
  relationships

- Transaction commit failed when an unloaded record was in the
  `transaction.bucketForType.updated` array. Using recordIsMoving fixed
  this issue
52fc905
@sly7-7

👍 Great, I confirm this fix an issue I encounter.

@mspisars

I can confirm that this still works against master. 👍
@wycats can we get this merged? Or is there something missing from this PR that needs to be added?

@bobey

I confirm that this PR fixes an issue on our app too.

@KasperTidemann

+1.

I too can confirm that this is a problem. Without this fix, calling record.unloadRecord() on a record that is in an appropriate state returns the following error:

Uncaught TypeError: Cannot call method 'relationshipBecameDirty' of undefined

@KasperTidemann

@tomdale, you got any input on this one?

@tomdale tomdale merged commit 6c2a961 into emberjs:master Apr 6, 2013

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment