Closed gr2m closed 10 years ago
Nothing wrong with what you are doing, but you can do it far more easily like this
var MeetingModel = Backbone.AssociatedModel.extend({
relations: [
{
type: Backbone.Many,
key: 'minutes',
collectionType: MinutesCollection,
isTransient : true // Will not serialize `minutes` on `save`
}
]
});
that's what I was looking for, most excellent! Thanks a lot, Dhruva!
I've a Meeting & a Minute model, as well as a MinutesCollection. Here's my setup, everything works great so far.
On save, I'd not like a meeting model to store the minutes as a property, as I store them separately. I achieve that currently by overiding the
toJSON()
method like so:That works, but I just want to make double sure that this is the right way to do it and that there are no side effects