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

embedded associations are now automatically added to the parent's transa... #711

Merged
merged 1 commit into from
May 2, 2013

Conversation

ghempton
Copy link
Member

@ghempton ghempton commented Feb 8, 2013

...ction

Should fix #686

@thingista
Copy link

Hi Gordon,

Sorry I might be confused... but how does it work to fix #686? Does it mean I have to explicitly create a transaction? I mean for instance, if I have a very simple model+controller like this:

App.Solution = DS.Model.extend({
sequences: DS.hasMany('App.Sequence', { embedded:'always' }),
});

App.SolutionsNewController = Ember.ObjectController.extend({
create: function(){
this.store.commit()
}
});

"create" still fires two POSTS to the server, even if the first one already sends all the necessary data (both solution and sequences data).

Thanks a lot
PJ

@ghempton
Copy link
Member Author

ghempton commented Feb 8, 2013

@thingista, yeah good point, I don't handle the default transaction here. This just solves for explicitly adding the parent to a transaction in which case all embedded records will be added as well.

@bobbus
Copy link
Contributor

bobbus commented Feb 10, 2013

@thingista , I think you are talking about issue #437 and #440 , for the #686 it should be fixed with this patch.
Thanks @ghempton !

@darthdeus
Copy link
Member

@ghempton this doesn't seem to merge without conflicts anymore :\

@ghempton
Copy link
Member Author

@darthdeus I just rebased, should work now

stefanpenner added a commit that referenced this pull request May 2, 2013
embedded associations are now automatically added to the parent's transa...
@stefanpenner stefanpenner merged commit 0e298f0 into emberjs:master May 2, 2013
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 this pull request may close these issues.

Ensure embedded record are always in the same transaction as their parent
5 participants