Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure document retains slug when edition title has special chars
We've been doing some investigative work into a bunch of sentry errors. I've gone down a bit of a rabbit hole and came across some fairly strange behaviour. There are a subset of documents in our database that don't have a slug. This is despite their being an after create for document which sets the slug to the documents id if one is not set based on the title of the first edition for whatever reason. This is being overriden by the #update_slug_if_possible method which is triggered by the #update_document_slug before_validation method. When the #update_slug_if_possible is passed a special character or characters from other languages that different alphabets are used friendly_id is unable to handle it and updates the slug to nil. We want to retain the default behaviour of the slug being defaulted to the id of the document. This commit ensures that's the case.
- Loading branch information