Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Stores and Nested Records cause error when committing changes #14

Open
blt04 opened this issue Oct 20, 2011 · 0 comments · May be fixed by #18
Open

Nested Stores and Nested Records cause error when committing changes #14

blt04 opened this issue Oct 20, 2011 · 0 comments · May be fixed by #18

Comments

@blt04
Copy link

blt04 commented Oct 20, 2011

I have a simple data structure:

Product = SC.Record.extend {
  courses: SC.Record.toMany('Course', {nested: true})
}

I create a nested store:

chainStore = product.get('store').chain();
editProduct = chainStore.find(product);

When I make changes to editProduct and call commitChanges(), SC produces an error:

oldChildren is undefined

in registerChildToParet at store.js:1382

If I access one of the courses in the product record using objectAt before creating the nested store, everything works:

product.get('courses').objectAt(0)
chainStore = product.get('store').chain();
editProduct = chainStore.find(product);

What is the proper procedure for using nested stores on records with nested children?

blt04 added a commit to blt04/sproutcore-datastore that referenced this issue Nov 1, 2011
blt04 added a commit to blt04/sproutcore-datastore that referenced this issue Nov 1, 2011
@blt04 blt04 linked a pull request Nov 1, 2011 that will close this issue
roydaniels pushed a commit to roydaniels/ember-datastore that referenced this issue Dec 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant