Skip to content

Validators should obey "allowNull" attribute #118

Closed

Description

@thisandagain

Validation should by bypassed on fields that "allowNull: true" and provide a null value. As per the model.js:

// if field has validators
if (self.validators.hasOwnProperty(field)) {
  // is it not null or allowNull is false?
  if (value === null && self.__options[field].indexOf("NOT NULL") === -1) {
    // bypass
  } else {
    // ...

Activity

  1. sdepold commented on Jan 4, 2012

    @sdepold
    Member

    would you like to send me a pull request and add a test ?

  2. janmeier commented on May 9, 2013

    @janmeier
    Member

    Implemented in #601

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions