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

Allow pre-validating against itself or another set of attributes #212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ragulka
Copy link

@ragulka ragulka commented Feb 27, 2014

This PR is a solution to #211. It allows pre-validating a set of attributes against itself or another set of attributes.

// Validate a hash of attributes against itself
// Pass in either `true` or an attribute hash as the 2nd parameter.
// Neither of the examples below will result in any errors.
var errors = model.preValidate({ password: 'value', passwordConfirmation: 'value' }, true);
var errors = model.preValidate({ password: 'value' }, { passwordConfirmation: 'value' });

Note: I did write the tests, but since npm install buster failed, I couldn't actually run them.

@chiefGui
Copy link
Collaborator

chiefGui commented Jan 7, 2015

+1! @thedersen

@chiefGui chiefGui mentioned this pull request Jan 14, 2015
@dottodot
Copy link

Any update on this?

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.

None yet

3 participants