-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Super_scaffold generator: _id field causes error #1456
Super_scaffold generator: _id field causes error #1456
Comments
I ran into this as well with fields like |
You can disable this particular For instance:
We're supposed to show you a message about that if we can't find the model but there's currently a bug. I think it will be fixed by this PR: bullet-train-co/bullet_train-core#835 |
…e` option Fixes: bullet-train-co/bullet_train#1456 Fixes: bullet-train-co/bullet_train#1507 This makes it so that if someone super scaffolds a field that ends with `_id` but does not explicitly include a `class_name` option then we'll try to guess the `class_name` based on the name of the field. For instance if you do this: ``` rails g super_scaffold Task Team event_id:super_select ``` We'll guess that `event_id` is a reference to the `Event` class. If we can find an `Event` class in your app then everything proceeds as if you had done this: ``` rails g super_scaffold Task Team event_id:super_select{class_name:Event} ``` If we can't find an `Event` model then you'll get a message saying so and telling you about the `{vanilla}` option that you can use to disable the `_id` related magic.
This is the message id returned by OpenAI, Anthropic, etc - not an internal id. I think this should be able to work as is, but I guess the workaround will be naming it something else, without
_id
at the end... Feels like it should be possible to have a text field calledsomething_id
though.The text was updated successfully, but these errors were encountered: