Skip to content

[BUG] uninitialized constant CreateAiModels #629

@houssemFat

Description

@houssemFat

Basic checks

  • I searched existing issues - this hasn't been reported
  • I can reproduce this consistently
  • This is a RubyLLM bug, not my application code

What's broken?

Running the ruby_llm rails generator with the following command rails generate ruby_llm:install chat:AiConversation message:AiChatMessage model:AIModel generate a class with name CreateAIModels which causes rails to crash with the error uninitialized constant CreateAiModels

How to reproduce

  1. install ruby_llm
  2. run rails generate ruby_llm:install chat:AiConversation message:AiChatMessage model:AIModel
  3. run rake db:migrate

Expected behavior

The generator creates a file named xxx_create_ai_models.rb with class name class CreateAiModels < ActiveRecord::Migration[8.0]

What actually happened

The origin of the issue comes from the file name and class name generation. The generator creates a file named xxx_create_ai_models.rb and the class name class CreateAIModels < ActiveRecord::Migration[8.0]

Environment

ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
gem "ruby_llm", "~> 1.12"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions