Skip to content

Instantly share code, notes, and snippets.

@patmaddox
Created October 18, 2011 19:34
Show Gist options
  • Select an option

  • Save patmaddox/1296455 to your computer and use it in GitHub Desktop.

Select an option

Save patmaddox/1296455 to your computer and use it in GitHub Desktop.
model = new ModelWithCollection() # add some stuff to a collection
child = model.collection().at(0)
child.set foo: 'bar'
model.save() # this doesn't trigger a save because the model doesn't know it's dirty
So how do I get the model to actually save after the child has been changed? Do I need to
have the model subscribe to its collection's change event, and then it marks itself as dirty?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment