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

Add documentation for using a callback for defaultsTo #5

Open nategood opened 10 years ago

nategood commented 10 years ago

The option to specify a callback for "defaultsTo" is quite handy. However, I happened to stumble across it by trial and error. Belongs in the docs: https://github.com/balderdashy/waterline-docs/blob/master/models.md#defaultsto

CWyrtzen commented 10 years ago

@mikermcneil and/or @particlebanana can we mark this noted and closed?

nategood commented 10 years ago

Did it ever find its way into the docs?

CWyrtzen commented 10 years ago

@nategood I'm not sure. I've marked it for review and someone will take a look.

devinivy commented 9 years ago

This is still not in the docs. Marked as such.

eddieajau commented 9 years ago

I think this is done now. See https://github.com/balderdashy/waterline-docs/blob/master/models/data-types-attributes.md#defaultsto

dmarcelino commented 9 years ago

To be honest I'm actually not aware of the callback option but I believe the OP means something like:

defaultsTo: function(cb) {
      cb(null, uuid.v4());
    }

Is this it @nategood?