Skip to content

Comments

Fix generator directory name to match Rails underscore convention#7

Open
infews wants to merge 1 commit intorubymonolith:mainfrom
infews:fix-generator-directory-name
Open

Fix generator directory name to match Rails underscore convention#7
infews wants to merge 1 commit intorubymonolith:mainfrom
infews:fix-generator-directory-name

Conversation

@infews
Copy link

@infews infews commented Feb 22, 2026

Summary

  • Renames lib/generators/nopassword/ to lib/generators/no_password/ to match Rails' generator name resolution convention

Problem

Rails resolves generator names using ActiveSupport::Inflector#underscore. Since "NoPassword".underscore returns "no_password", Rails looks for generators in lib/generators/no_password/ — but the directory was named lib/generators/nopassword/.

This causes both invocation forms to fail:

$ rails generate nopassword:install
Could not find generator 'nopassword:install'
Did you mean? no_password:install

$ rails generate no_password:install
Could not find generator 'no_password:install'

Fix

Rename the directory from nopassword to no_password so Rails can find the generator under either invocation.

Test plan

  • rails generate no_password:install succeeds
  • Generator creates controller, views, and route as expected

🤖 Generated with Claude Code

Rails resolves generator names using ActiveSupport's `underscore` method.
`"NoPassword".underscore` returns `"no_password"`, so Rails looks for
`lib/generators/no_password/` but the directory was `lib/generators/nopassword/`.

This caused `rails generate nopassword:install` to fail with:
  Could not find generator 'nopassword:install'
  Did you mean? no_password:install

And `rails generate no_password:install` to also fail because
the directory didn't match.

Rename the directory from `nopassword` to `no_password` to fix
both invocation forms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant