ManageIQ / ManageIQ/inventory_refresh
secondary_ref lookup ergonmics
- Dominant language
- Ruby
- Stars
- 1
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
- secondary_ref is an odd name choice...perhaps `extra_indexes`, `alternate_indexes`, `lookups`?
- When you use a secondary_ref, the current syntax is
```ruby
# collection def
:secondary_refs = {:by_name => %i(name)}
# in parser
collection.lazy_find({:name => "foo"}, {:ref => :by_name})
```
A more ergnomic syntax would be
```ruby
collection.lazy_find(:by_name => {:name => "foo"})
```
Contributor guide
Research direction
Start with the parser handling collection.lazy_find and the existing secondary_ref declaration. Compare the current two-argument lookup form with the proposed single-argument form, then resolve the naming alternatives before defining the scope. Done means the API choice and migration behavior are agreed and documented in the relevant implementation and tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100