Problem
The model binder in src/runtime/server/utils/binder.ts currently uses naive pluralization by simply appending "s" to model names when looking up database tables. This causes failures for:
- Words that don't pluralize:
sms → smss (should stay sms)
- Sibilants requiring "es":
kiss → kisss (should be kisses)
- Consonant + y words:
city → citys (should be cities)
- Words ending in f/fe:
leaf → leafs (should be leaves)
- Other irregular pluralization patterns
Expected Behavior
The model binder should intelligently handle English pluralization rules and fall back to the original model name when appropriate.
Problem
The model binder in
src/runtime/server/utils/binder.tscurrently uses naive pluralization by simply appending "s" to model names when looking up database tables. This causes failures for:sms→smss(should staysms)kiss→kisss(should bekisses)city→citys(should becities)leaf→leafs(should beleaves)Expected Behavior
The model binder should intelligently handle English pluralization rules and fall back to the original model name when appropriate.