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

Join model scaffolder throws an error if you don't supply class names #1517

Open
jagthedrummer opened this issue Jun 6, 2024 · 0 comments
Open

Comments

@jagthedrummer
Copy link
Contributor

For simple cases we should be able to guess a class name, and if we can't we should output a friendlier message explaining what the user should do.

This is what happens currently:

$ rails generate super_scaffold:join_model Assignment membership_id task_id
Generating model with 'bin/rails generate model Assignment membership:references task:references'
Updating './app/models/assignment.rb'.
Updating './app/models/assignment.rb'.
/Users/jgreen/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/bullet_train-super_scaffolding-1.7.11/lib/scaffolding/attribute.rb:180:in `partial_name': Invalid field type: . (RuntimeError)
        from /Users/jgreen/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/bullet_train-super_scaffolding-1.7.11/lib/scaffolding/transformer.rb:656:in `block in add_attributes_to_various_views'
        from /Users/jgreen/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/bullet_train-super_scaffolding-1.7.11/lib/scaffolding/transformer.rb:632:in `each'
        from /Users/jgreen/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/bullet_train-super_scaffolding-1.7.11/lib/scaffolding/transformer.rb:632:in `each_with_index'
        from /Users/jgreen/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/bullet_train-super_scaffolding-1.7.11/lib/scaffolding/transformer.rb:632:in `add_attributes_to_various_views'
        from /Users/jgreen/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/bullet_train-super_scaffolding-1.7.11/lib/bullet_train/super_scaffolding/scaffolders/join_model_scaffolder.rb:81:in `run'
        from /Users/jgreen/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/bullet_train-super_scaffolding-1.7.11/lib/scaffolding/script.rb:268:in `<main>'
        from <internal:/Users/jgreen/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/Users/jgreen/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
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