-
Notifications
You must be signed in to change notification settings - Fork 132
Add GlobalId::Identification::build_global_id #186
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
base: main
Are you sure you want to change the base?
Add GlobalId::Identification::build_global_id #186
Conversation
Can't wait to this merged ! Another use case I'm facing: populate a select/options without ajax with a lot of options of mixed models. |
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.
I get the idea but I don't like this implementation. First, it doesn't have the signed counterpart. Second, it is duplication a lot of code with GlobalID.create
, so we will probably end up changing one and forgetting to change the other.
Hey @rafaelfranca! Thanks for reviewing the code. I have fixed the code to reuse the existing logic, while also adding the signed counterpart. You can let me know your thoughts about the current iteration :) P.S: The tests that are failing seem to be something related to Rails 8, and not due to the code in this PR. |
Inspired from #181.
This PR aims to add a class method to the models that'd give an ability build your own GlobalIDs
Example: