Singularize get's confused with snake_case words
mauromorales opened this issue · comments
I was trying hanami and created a resource called :control_exercises
. I wasn't able to use the path helper so I listed my routes and saw this:
root GET, HEAD / Web::Controllers::Home::Index
control_exerces GET, HEAD /control_exercises Web::Controllers::ControlExercises::Index
new_control_exercis GET, HEAD /control_exercises/new Web::Controllers::ControlExercises::New
control_exerces POST /control_exercises Web::Controllers::ControlExercises::Create
Digging deeper I came into the utils repo and found that the problem is that when passed through inflector singularize, the special word exercise
doesn't get picked because of the control_
prefix.
utils/lib/hanami/utils/inflector.rb
Line 428 in 2cc692f