Split off friendly race UUIDs into its own gem #730
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently I've been wanting to split some of our more general-purpose code into gems so others can benefit from the work, and this one was a pretty straightforward candidate.
This splits off the logic that shortens race UUIDs into reversible, stateless slugs for use in URLs. It's now a gem that can be used in any Rails application on any model that has UUID primary keys. It is located at glacials/friendly_uuid.
Another split I might do later is our
Duration
implementation, as it's more precise thanActiveSupport::Duration
and has been battle tested.There are some formatting changes included here because I'm thinking of switching us over to ruby-formatter/rufo so I'm letting it leak some changes in as I test it out.