Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator migration file name inconsistent with class name #460

Open
davelooi opened this issue Mar 24, 2022 · 0 comments
Open

Generator migration file name inconsistent with class name #460

davelooi opened this issue Mar 24, 2022 · 0 comments

Comments

@davelooi
Copy link

Description

Running the generator for a model under module results in inconsistent filename.

Reproduction Instruction

bundle exec rails g statesman:active_record_transition Game::Chess Game::ChessTransition

The error

The resulting filename would be 20220324024427_create_chess_transitions.rb
And the resulting class name would be class CreateGameChessTransitions < ActiveRecord::Migration[6.1]

Running this migration results in error:

rails aborted!
NameError: uninitialized constant CreateChessTransitions
Did you mean?  CreateGameChessTransitions


Caused by:
NameError: uninitialized constant CreateChessTransitions
Did you mean?  CreateGameChessTransitions

Expected outcome

The generated filename should be consistent with the classname.

20220324024427_create_game_chess_transitions.rb

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

No branches or pull requests

1 participant