ubicloud/prog/victoria_metrics
Jeremy Evans 00e65f19fd Allow create_with_id to take Sequel::Model object instead of id
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.
2025-11-14 09:18:44 +09:00
..
victoria_metrics_resource_nexus.rb Allow create_with_id to take Sequel::Model object instead of id 2025-11-14 09:18:44 +09:00
victoria_metrics_server_nexus.rb Apply Layout/EmptyLinesAfterModuleInclusion cop 2025-10-15 20:46:13 +03:00