balderdashy / waterline-docs

WARNING: The content in this repo is out of date! See https://github.com/balderdashy/sails-docs for the most up-to-date documentation
452 stars 161 forks source link

Document model definition option: `ignoreProperties` #66

Closed dmarcelino closed 9 years ago

dmarcelino commented 9 years ago

ignoreProperties are defined in the adapter's adapter.js like:

// These properties should be ignored in Waterline validations
validations: {
  ignoreProperties: [ 'async', 'special']
}

would allow:

attributes: {
        email: {
          type: 'email',
          special: true
        },
        cousins: {
          collection: 'related',
          via: 'property',
          async: true
        }
}

to be accepted by waterline without throwing errors.

Full details on balderdashy/waterline#482.

@mphasize, I stumbled upon ignoreProperties (which I had no knowledge of) while doing a code change. Can you possibly write a few words about it in models.md? Thanks! :smiley:

mphasize commented 9 years ago

Yep, I guess I should do that. :-)

dmarcelino commented 9 years ago

Thanks @mphasize :wink:

mphasize commented 9 years ago

@dmarcelino Done, see PR https://github.com/balderdashy/waterline-docs/pull/68

dmarcelino commented 9 years ago

Thanks @mphasize!

ghost commented 9 years ago

@mphasize It seems that since it has been moved to https://github.com/balderdashy/waterline-docs/blob/master/models/validations.md the configuration part (for config/models.js) was lost.