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.