mikeric/rivets — pull request #21 by pgib (2012-07-10 21:31:40+00:00)
Title: Reverse set the model from the element on initial bind

If the model has no value for a given property, but the corresponding element does, update the model with that value. This is mostly the case with select lists that have no unselected state. The issue arises when the user makes no selection because the first (default) value of the select list is okay and no event is fired that would otherwise update the model.

Backbone.ModelBinding does this, and after converting to Rivets, I saw how the absence of this affected things:

https://github.com/derickbailey/backbone.modelbinding/blob/master/backbone.modelbinding.js#L253

Not sure if this is the approach you want to take for this scenario, so feel free to solve it in a different way. Perhaps the model should be initialized with default values that reflect the interface, and documentation around this is sufficient... In fact, I think that probably is a more elegant approach to take...