Created
October 18, 2011 19:34
-
-
Save patmaddox/1296455 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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