Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix recursion error when saving from within a change event.
- Loading branch information
Matt
committed
Nov 23, 2010
1 parent
9e1fcfa
commit 57194be
Showing
2 changed files
with
10 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
57194be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit seems to cause other scenarios to regress. Specifically, because
set
callsvalidate
andset
is getting short wired whenattrs
is false,validate
never runs onsave
s to Models instantiated with attributes. BecauseCollection.create
's implementation relies on that scenario validation does not get triggered when Models are created usingCollection.create
even though the documentation implies otherwise (http://documentcloud.github.com/backbone/#Collection-create).Examples here: https://gist.github.com/813138
On further inspection of
set
it now shortwire returnsthis
with empty attrs before runningvalidate
so getting validate to run onCollection.create
may just need a localized fix there.57194be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix in your pull request for
Collection#create
... which has been merged to master.