Open martinraie opened 12 years ago
Yehp - that's intended. The idea is that history should only be valid until someone overrides it.
Ok. I didn't know that.
Although it doesn't make sense to me that someone else can override my old url. I think that when my old url continues working after rename, it shouldn't stop working at some arbitrary moment.
Maybe there could be an option where we could specify which behavior we expect from our slug history?
Yup, that makes a lot of sense - I don't have time to do it at the moment personally, but I'd be more than happy to accept a pull request implementing it if you're willing / able to do that. If not, I can probably organise some time in the near future to do so?
My current thought is that something along the lines of immutable_history or the like - not sure how well that describes the intention though?
I checked the code but I'm afraid it currently takes too much time for me to study all the inner workings of Slugged. I'll get back to it when I have more time.
@martinraie Still want this feature? If so, I'll take a look at implementing it this weekend. Cheers!
Sorry, I was out of office and couldn't reply earlier.
I had one specific use case where lack of this option was very noticeable. I made a quick workaround for this use case so the problem is currently not disturbing me too much. But I'd still appreciate if I could use this option.
Slugged.next_value method only checks if any of the records already has the same slug (cached_slug) but it doesn't check if some recored has had the slug previously (slug history).