Closed shem8 closed 3 years ago
@jarrodconnolly can you look at this please? some models are having null slugs probably because of this.
Thank you, taking a look. The PR seems reasonable, though I would like some tests around this before merging.
I added a test that does fail before your change and passes after, I believe this is the scenario you may be running into. Let me know if that makes sense.
Published v1.3.2 with this change.
@shem8 Going to close this as the change has been published.
@jrsakizci If you are seeing models with null slugs for another reason please file another issue with some details relating to that use case.
I want to add a slug field to my model. I'm trying to do so with a new migration in using
regenerateSlug
for all the model's instances, but I keep getting null as the slug. Looks like it's becauseforceGenerateSlug
is ignored when nothing changed on the model: https://github.com/jarrodconnolly/sequelize-slugify/blob/4a6d98adecd4fc431dfdc8dfe234f9bbe98dda81/lib/sequelize-slugify.js#L33