Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

collection.add() doesn't properly prepare models. #75

Closed
mikefranklin opened this issue Jul 22, 2014 · 3 comments
Closed

collection.add() doesn't properly prepare models. #75

mikefranklin opened this issue Jul 22, 2014 · 3 comments
Labels
Milestone

Comments

@mikefranklin
Copy link

This Collection initializes models with an attribute. Create() works as expected, including the attribute in the object. Add() uses only the passed-in data.

web_inspector__bolzano_local

A non-Firebase-extended collection returns the expected content using add():

web_inspector__bolzano_local

I imagine this is because Backfire create() uses

model = Backbone.Collection.prototype._prepareModel.apply(this, [model, options]);

while add() does not.

It's not clear if the difference is a feature, or an oversight.

@katowulf
Copy link
Contributor

Try to contact backbone and investigate SO questions; see if there is any definitive answer to the roles of add vs. create. Then specify our version of these behaviors in the README and make sure we are consistent (which will probably be done as part of #10)

@katowulf katowulf added the bug label Sep 15, 2014
@katowulf katowulf modified the milestone: 0.4.0 release Sep 15, 2014
@davideast
Copy link
Contributor

#100 addressed this issue. Will be available in the 0.5 release.

@davideast davideast reopened this Nov 10, 2014
@davideast
Copy link
Contributor

This was fixed in the latest release #115.

Thank you so much for your details on this bug, @mikefranklin! It saved me a lot of time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants