Fix generator directory name to match Rails underscore convention#7
Open
infews wants to merge 1 commit intorubymonolith:mainfrom
Open
Fix generator directory name to match Rails underscore convention#7infews wants to merge 1 commit intorubymonolith:mainfrom
infews wants to merge 1 commit intorubymonolith:mainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lib/generators/nopassword/tolib/generators/no_password/to match Rails' generator name resolution conventionProblem
Rails resolves generator names using
ActiveSupport::Inflector#underscore. Since"NoPassword".underscorereturns"no_password", Rails looks for generators inlib/generators/no_password/— but the directory was namedlib/generators/nopassword/.This causes both invocation forms to fail:
Fix
Rename the directory from
nopasswordtono_passwordso Rails can find the generator under either invocation.Test plan
rails generate no_password:installsucceeds🤖 Generated with Claude Code