Uninitialized relations set to null #392

Open
nareshbhatia opened this Issue Aug 6, 2013 · 0 comments

Comments

Projects
None yet
2 participants

I am having an issue with making backbone-relational work with backbone-validation. It appears that backbone-relational sets any uninitialized relations to null. Could someone please confirm this? (The docs do not explicitly state this.) The main issue is as follows:

backbone-validation will not validate an attribute that has never has been set (either explicitly or with a default value). This is very useful when validating forms as they are populated. However, since backbone-relational sets uninitialized relations to null, these relations also get validated when we try to set any other attribute. If any of these relations are "required", then the validation fails and hence the set() fails. Bottom line is, one cannot set ANY attribute of an object that has uninitialized required relations.

Can anyone think of a workaround for this? Is it possible to not create attributes for relations that have not been intialized yet.

nareshbhatia referenced this issue in NYTimes/backbone.stickit Aug 6, 2013

Closed

defaultOption on Chosen select is not working #130

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment