Validations will now be called upon .save() and allowNull: true skips va... #601

Merged
merged 2 commits into from May 9, 2013

Projects

None yet

4 participants

@durango
Member
durango commented May 9, 2013

...lidations (if the value is null).

@sdepold sdepold commented on an outdated diff May 9, 2013
@@ -211,7 +218,9 @@ module.exports = (function() {
Utils._.each(self.values, function(value, field) {
// if field has validators
- if (self.validators.hasOwnProperty(field)) {
+ var allowsNulls = (self.rawAttributes[field].allowNull && self.rawAttributes[field].allowNull === true && (value === null || value === undefined));
@sdepold
sdepold May 9, 2013 Member

maybe hasAllowedNull ?

@durango durango merged commit d7a96a1 into sequelize:master May 9, 2013

1 check passed

default The Travis CI build passed
Details
@edgarjs
edgarjs commented May 15, 2013

is this pushed to the last version in npm?

Thanks

@janmeier
Member

NPM was last updated 16 days ago, so no https://npmjs.org/package/sequelize.

You might bug @sdepold to push it, but I don't know his criteria for pushing new versions.

@durango durango deleted the durango:validate-save-null branch May 15, 2013
@janmeier
Member

@edgarjs This has now been published to npm

@edgarjs
edgarjs commented May 26, 2013

thanks!

On Sun, May 26, 2013 at 5:24 AM, Jan Aagaard Meier
notifications@github.com wrote:

@edgarjs This has now been published to npm

Reply to this email directly or view it on GitHub:
#601 (comment)

@sdepold
Member
sdepold commented May 26, 2013

omg :) how cool is this PR ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment