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

Backbone.Collection.add doesn't respect the { merge : true, at: <index> } option. #520

Open
Sundarasan opened this issue Mar 26, 2015 · 4 comments
Labels

Comments

@Sundarasan
Copy link

I want to merge and move a model to a particular index. When I pass the option { merge : true, at: 0 } it does merge but not moving the model to the given index.

@philfreo
Copy link
Collaborator

Hi @Sundarasan - can you provide a test case showing the expected (but broken) behavior?

@pmckinnon
Copy link
Contributor

I believe there is a bug in backbone-relational's Collection.set implementation. The merge parameter is being overridden to false, but I can't think of any reason why it should be. Because of this existing model updates get dropped.

add(..., {merge: true}) works as expected when I remove this.

@PaulUithol
Copy link
Owner

Because at that point, updates should already have been merged into the model - through the _prepareModel->findOrCreate route. Do you maybe have an example where that doesn't happen? Removing the merge: false causes other tests to fail.

@pmckinnon
Copy link
Contributor

I'm not seeing the updates getting in, I'll see if I can pin things down better.

@bpatram bpatram added the bug label Mar 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants