-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Adding comparison to UUID #11023
Comments
sort_by &.to_s ? |
I guess that works too. Would there be a way to point people to using that in this case?
It may just be me, but using |
@jwoertink This looks more like a pretty typical RTFM situation ;) |
That said, maybe uuid could be sortable. We could check what other languages do. |
@jwoertink What's your use case to sort UUID? Maybe sortable UUID should be a thing on its own? There are these for example: |
I'm creating a composite key based on the standard UUID where they are in alphabetical order. This is so I can join 2 records in the DB where their primary keys are UUID, and I don't end up with duplicate relations where they are in different orders. If they're always in alphabetical order, then I can guarantee no duplicates. |
Resolved by #11352 |
Should UUIDs be comparable so
Array(UUID)
could be sorted alphanumerically?I'm assuming this wasn't originally added because UUIDs aren't normally sorted, but if you only need them in alphanumerical order, then right now you have to map them to strings. However, if you still need them as UUID, then you would have to re-map them back to UUID after sorting.
The text was updated successfully, but these errors were encountered: