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

patch and wait #13

Closed
yallups opened this Issue Sep 2, 2014 · 2 comments

Comments

Projects
None yet
4 participants
@yallups

yallups commented Sep 2, 2014

I am noticing a potential issue in the last lines of the model's save function. When I try to make a patch and I also want to wait to make the changes such as:

model.save({ 
    /*attrs*/
}, {
    patch: true,
    wait: true
}

the attrs set in sync are set to the serialization to the model.

        if (method === 'patch') options.attrs = attrs;
        // if we're waiting we haven't actually set our attributes yet so
        // we need to do make sure we send right data
        if (options.wait) options.attrs = _.extend(model.serialize(), attrs);
        xhr = this.sync(method, this, options);

        return xhr;

if I am sending a patch I definitely don't want to send over EVERYTHING that is attached to my model but maybe I am missing a point here.

This was referenced Oct 5, 2014

@mikehedman

This comment has been minimized.

Show comment
Hide comment
@mikehedman

mikehedman Nov 10, 2014

I'd vote for switching the "enhancement" label with a "bug" label :)
As the code is working now, it's not in agreement with the documentation (and I think the documentation is right).

mikehedman commented Nov 10, 2014

I'd vote for switching the "enhancement" label with a "bug" label :)
As the code is working now, it's not in agreement with the documentation (and I think the documentation is right).

@aaronmccall

This comment has been minimized.

Show comment
Hide comment
@aaronmccall

aaronmccall commented Dec 6, 2014

👍

pgilad added a commit that referenced this issue Aug 26, 2015

Fix Patch & Wait
- Originally written by @nickryall at #23
- Fixes #13
- Fixes #23
- Fixes #53

@pgilad pgilad referenced this issue Aug 26, 2015

Merged

Fix Patch & Wait #58

@pgilad pgilad closed this in #58 Aug 26, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment