1602/jugglingdb — pull request #315 by absynce (2013-08-14 19:47:55+00:00)
Title: Add option to skip validation when saving new model

Previously, if a _new_ instance of a model calls `save({ validate: false }`, validation still occurred because it was calling `Model.create`.

I've added the ability to pass the option to validate to the Model.create via the `data` parameter.

For example:

var p = new Person();
p.validatesPresenceOf('name');
p.isValid().should.be.false;
p.isNewRecord().should.be.true;
p.save({ validate: false }, function (err) {
should.not.exist(err);
p.isNewRecord().should.be.false;
});

I included the test for this case as well.

P.S. I know passing the data into the `data` parameter looks odd when it is then set via `data = data.data;`, but I couldn't think of a better name and didn't want to rename the existing parameter. Ideas are welcome.