Use sequence number for reserved ID instead of throwing an exception #262

davejamesmiller opened this Issue Apr 6, 2012 · 2 comments

2 participants


Is there any way to have FriendlyId quietly append --2 to the slug name instead of triggering an error if the name is reserved? I just need to prevent it clashing with /new, but not to prevent users creating a post titled "New".

My current solution is to quietly rename it "new2" - but the code is a bit verbose, and it can end up being new2--2 if there is more than one. Is there a better solution?



There currently is no way other than monkey patching, but I think it's a good idea. For FriendlyId 4.1 I'd like to have conflict resolution be easily configurable, and extending this to include not only used slugs, but reserved ones as well, makes sense.


Closing this for lack of followup. If anybody wants to implement this, patches are welcome.

@norman norman closed this Apr 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment