thedersen/backbone.validation — pull request #125 by magnusvk (2013-05-02 15:10:48+00:00)
Title: Play nice with associations

When my models have associations, backbone.validation's flatten method leads to call stack overflows. What happens is that it flattens the entire Backbone model, event bindings and all. And in the cause of that it just descends and descends and descends the hierarchy ad infinitum.

Simple solution: when a value we encounter is a Backbone.Model, we unwrap it and look only at the attributes. This seems to work fine.

The associations library I use that causes this is here:
https://github.com/rjz/backbone.associate