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 than ActiveSupport::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.
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.