jarrodconnolly / sequelize-slugify

Sequelize Slugify is a plugin for the Sequelize ORM that automatically creates and updates unique, URL safe slugs for your database models.
https://sequelize-slugify.nestedquotes.ca/
MIT License
56 stars 27 forks source link

Feature: Option to Prevent Overwriting Slug #2

Closed bpartridge83 closed 8 years ago

bpartridge83 commented 8 years ago

Adds option to slugOptions, preventing changed slugs from overwriting existing slugs, when overwrite is false.

Example:

SequalizeSlugify.slugifyModel(Post, {
    source: ['title'],
    overwrite: false
});
jarrodconnolly commented 8 years ago

@bpartridge83

Thank you for your pull request!

I accepted it but made a change afterwards to the default. I wanted the default for overwrite to be true in most cases.

I also added some tests and documentation around your change.

I hope this will still work for you, thanks again for your change.