rubyforgood / mutual-aid

Mutual aid management platform for groups who build, support, and strengthen community resilience.
https://github.com/rubyforgood/mutual-aid/projects/4
MIT License
54 stars 61 forks source link

Compose field name #1004

Closed solebared closed 2 years ago

solebared commented 2 years ago

Why

Enhances fieldNameWithPrefix utility function so it can support multiple segments in the field name.

Mostly wanted to rescue this useful change from a wip branch that probably won't get merged in.

What

Renames the function as composeFieldName and makes the implementation recursive.

In combination with the partial function, allows components to generate field names for deeply nested attributes.

Testing

Enhanced existing unit test.

Pre-Merge Checklist