mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-11-28 00:20:26 +08:00
If a non-String is passed, call id on it to get the id. DRYs up about 40 callers. Most changes by Claude Code using the following prompt: ``` ResourceMethods::ClassMethods#create_with_id currently accepts a id argument, which is expected to be a uuid String. Add support so that if a non-String argument is passed, it call the id method on the argument to get the id. Afterward, update all `create_with_id` calls in the project where the first argument uses the `id` method call on an object to instead pass the object directly, in order to simplify the code (e.g. convert `create_with_id(object.id, ...)` to `create_with_id(object, ...)`). ``` I had to tweak create_with_id to support nil values, as we apparently pass nil values. My prompt to Claude didn't mention nil values, so that's more an issue with the prompt than Claude. I also had to modify brittle specs that mocked create_with_id. |
||
|---|---|---|
| .. | ||
| victoria_metrics_resource_nexus.rb | ||
| victoria_metrics_server_nexus.rb | ||