Commit 5574170
committed
ogar-from-rails: real inflector for controller singularisation
Replace the naïve strip-trailing-`s` singulariser (which produced
`Searches → searche`, `Capabilities → capabilitie` — flagged as an
honest gap on #152) with a minimal case-preserving English inflector:
- `-ies → -y` (Capabilities → Capability, Diaries → Diary)
- `-{ch,sh,ss,x,z}es` drop only `es` (Searches → Search, Classes →
Class, Boxes → Box)
- plain `-s` drop `s` (Nodes → Node); `-ss` (Address) and
non-plural words untouched.
Not a full inflector — no irregulars/Latin plurals (controller names
don't use them); the failure mode is a slightly-off identifier, never a
wrong route. Both `controller_to_model` and `container_of` route through
it. Unit test locks the rules + the two real OSM regressions end-to-end.
Regenerated the parked OSM DO-arm snapshot (actions.rs + osm_actions.rail)
so `osm::search::*` / `osm::capability::*` read correctly. Parked
osm-domain crate still builds.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP1 parent 5d29a22 commit 5574170
3 files changed
Lines changed: 176 additions & 115 deletions
File tree
- .claude/harvest/osm-website-rs
- crates/osm-domain/src/generated
- harvest
- crates/ogar-from-rails/src
0 commit comments