-
-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Reserved words validation fails even if other valid slug candidates exist. #536
Comments
+1 |
+1 |
We're looking at this issue, in the context of other changes and improvements. Please keep subscribed to this issue if you're interested in updates. |
I would love to provide a patch for that, it is ok @xymbol @reichertm @norman or are you already working on this? |
@hajder Please, feel free to do so. Even if something didn't play well with other changes, we can either get the patch fixed, reuse parts of it or, at least, add a note with the credits. And yes, we've been working on this. Thanks! |
Ok, so I know how to fix that problem on the conceptual level but not sure about the code. Maybe someone can help out with that? (@xymbol @norman) In |
This is now implemented in 23117f7. |
friendly_id 5.0.2, rails 4.1.0.rc1, ruby 2.1.0
A validation error 'Friendly is reserved' is being thrown if the first slug candidate happens to be a reserved word, even if the next slug candidate is valid. Perhaps all the slug candidates should be tried before the 'reserved' error is thrown.
e.g.
Model 'User' with fields 'name' and 'location' has the following slug definition:
The reserved words contains 'new'
When you try to create a user with name 'new' and location 'ny' the error gets thrown. Perhaps validation should pass creating slug 'new-ny' or such.
The text was updated successfully, but these errors were encountered: