Fix: unload record with relationships #567

Merged
merged 1 commit into from Apr 6, 2013

Conversation

Projects
None yet
6 participants
Contributor

ppcano commented Dec 31, 2012

  • 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
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
Contributor

sly7-7 commented Jan 18, 2013

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

Contributor

mspisars commented Jan 31, 2013

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 commented Feb 4, 2013

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

Contributor

KasperTidemann commented Feb 6, 2013

+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

Contributor

KasperTidemann commented Feb 7, 2013

@tomdale, you got any input on this one?

tomdale added a commit that referenced this pull request Apr 6, 2013

Merge pull request #567 from ppcano/unload-fix
Fix: unload record with relationships

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

1 check passed

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