Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to support Backbone 0.9 #19

Merged
merged 2 commits into from
Feb 29, 2012
Merged

Conversation

trevorquinn
Copy link
Contributor

Couple changes:

  • Changed reference to private Backbone method from _performValidation to
    _validate to match Backbone 0.9
  • Also updated qunit references from "equals" to "equal" to avoid deprecation errors in the unit test

Problem is, Backbone 0.9 won't allow invalid models to be created, which means you can't create empty models with required attributes. So most of the unit tests will still fail. The master version of Backbone removes this model creation restriction, so hopefully a future release of Backbone won't have it.

errors.
Changed reference to private Backbone method from _performValidation to
_validate to match Backbone 0.9
@nealstewart
Copy link
Owner

Hey man. Thanks a lot for doing this! I've been really busy and not doing much client-side code, so I haven't had to scratch the validation itch in a while. I'll take a look over this tomorrow and probably pull 'er in!

@trevorquinn
Copy link
Contributor Author

Okay, so Backbone 0.9.1 does allow invalid models to be created (unlike 0.9.0), because silent:true is checked inside the Backbone _validate function. If found, the Backbone validate function is not called. So I needed to copy that silent:true check into the backbone.validations newPerformValidation function. All unit tests now pass.

nealstewart added a commit that referenced this pull request Feb 29, 2012
Changes to support Backbone 0.9
@nealstewart nealstewart merged commit 5a9de79 into nealstewart:master Feb 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants