Say I have a uniqueness constraint on name
inside its has_many association. This would mean I don't need the ugly numeric sequence added to conflicting slugs.
As an example 2 slugs might get the same name in a game
db from 2 different people having a game called 'cards' /person/1/games/cards
and person/2/games/cards
these are 2 different URLs but the slug on the second will look like person/2/game/cards2bc08962-b3dd-4f29-b2e6-244710c86106
. person has a name uniqueness constraint on the name of their games so they cant have 2 games called 'cards' which stops 2 of the same slug being generated.
Problem is that the name of the games are all sorted in the one db so the conflicting slugs will have the numeric sequence added when its not needed, so urls become unnecessarily ugly.
Hope that made sense as to why I want it.
Anyway. How can I stop the numeric sequence from being added to conflicting slugs?