You can use the beforeValidate
lifecycle method to do this.
Try this:
this.beforeValidate = function () {
this.slug = slugify(this.name);
};
Note: This did not work prior to Model@0.3.2
, which had a bugfix for inconsistent lifecycle methods.