documentcloud/backbone — Issue #955: Collection#fetch updates existing model instances (vs replacing)
Author: benvinegar
Created: 2012-02-04 02:11:00+00:00
State: open

If I create a new model, and then call fetch, it will update that model's attributes.

If I create a collection of models, and then call fetch, it won't update the existing models – it will replace them with new instances.

This is painful because I cannot cache references to the collection's model instances, as the references become invalid once a fetch occurs. Instead I'd have to cache references to the collection, and do Collection#get every time I want to access the model. Maybe that's acceptable, but it seems reasonable that a collection should be able to perform a fetch/update without invalidating existing model instances.