guncebektas / meteor-friendly-slugs

Meteor package to generate URL friendly slugs from a field with auto-incrementation to ensure unique URLs.
65 stars 15 forks source link

[Feature] make updateSlug conditional #30

Closed bogdanrn closed 8 years ago

bogdanrn commented 8 years ago

I want to make the updateSlug to be conditional based on the doc that is updated.

Products.friendlySlugs({
  slugFrom: 'title',
  slugField: 'slug',
  distinct: true,
  updateSlug: function(doc){
    return (doc.published != true);
  },
});
bogdanrn commented 8 years ago

I made a pull requrest here #31

todda00 commented 8 years ago

Merged #31 and released with 0.5.0