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

Super_scaffold generator: _id field causes error #1456

Open
swombat opened this issue May 13, 2024 · 2 comments
Open

Super_scaffold generator: _id field causes error #1456

swombat opened this issue May 13, 2024 · 2 comments

Comments

@swombat
Copy link

swombat commented May 13, 2024

➜  promptcraft git:(main) ✗ rails generate super_scaffold Output PromptExecution,Prompt,Project,Team label:text_field results:text_area input_tokens:number_field output_tokens:number_field message_id:text_field user_rating:number_field
/Users/danieltenner/.rvm/gems/ruby-3.3.0/gems/activesupport-7.1.3.2/lib/active_support/inflector/methods.rb:290:in `const_get': uninitialized constant Message (NameError)

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 called something_id though.

@ndbroadbent
Copy link

ndbroadbent commented May 25, 2024

I ran into this as well with fields like api_token_id and token_id - I'm setting up some models for API integrations where I enter API token IDs and secrets. I can see why _id is treated as a special case though, so maybe I'll go with _identifier for now.

@jagthedrummer
Copy link
Contributor

You can disable this particular _id related behavior by including the {vanilla} on the field in your super scaffolding command.

For instance:

rails generate super_scaffold SomeModel Team some_id:text_field{vanilla}

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

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

3 participants