-
-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix blank slugs #571
Fix blank slugs #571
Conversation
@xymbol Thanks for working on this! I'm wondering if we need to bump a version for this, given the change in how slugs are generated, or would this be considered only a bug fix. Any thoughts? |
Is there any harm in bumping a minor version? |
I don't think so, calling this 5.1 wouldn't be a big deal, I just want to make sure that we only do so if that correctly communicates the degree to which this PR changes the library. |
Make more consistent with test suite.
Filter out unwanted slug candidates from generator.
@@ -202,6 +202,12 @@ def self.name | |||
end | |||
end | |||
|
|||
test "should sequence blank slugs without a separator" do | |||
with_instance_of model_class, :name => "" do |record| | |||
assert_match(/\A([a-z0-9]+\-){4}[a-z0-9]+\z/, record.slug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xymbol Sorry for taking basically forever to get back to you on this. Just a minor thing - since Ruby 1.9 we have \h
for hexadecimar characters, so perhaps this could be checked more tersely with /\A[\h-]{36}\z/
instead here and anywhere else in the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@norman Sure, I would like to see that regular expression factored out somewhere. It's all over the place.
@xymbol Merging this - thanks and sorry again for the long delay in responding. Let's get your other recent changes in and release everything as 5.1. Before that I think we need to do a few updates on the Changelog too. |
Fabulous! |
@norman I've done that already waiting for this, pushing to a branch so that you can review. |
No description provided.