I have a model with a backbone collection as an attribute. When I create a new model and save it along with its collection to the database it all works fine.
However, when I create a new model, its collection contains the previous models values. All the other properties are blank as expected.
I've defined my model defaults like this:
defaults: {
InsertionOrderNumber: null,
ClientID: null,
CampaignName: null,
FromDate: null,
ToDate: null,
TotalBudget: null,
ManagementFee: null,
AgencyCommission: null,
SourceDocuments: new Uploads() //this is the collection
}
For some reason it seems like the same instance of the collection is being used for all new models of that type.
Any idea why this is happening?
Thanks in advance =)