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 scaffolding a trix_editor shouldn't add a text column to the model #858

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

Comments

@jagthedrummer
Copy link
Contributor

The trix_editor fields are powered by Rails Action Text feature, which stores the text in a separate table. To prevent possible confusion we should avoid adding a text column to tables that will always be empty.

For instance, if you do this:

rails g super_scaffold Task Team name:text_field description:trix_editor 

You end up with a migration like this:

class CreateTasks < ActiveRecord::Migration[7.1]
  def change
    create_table :tasks do |t|
      t.references :team, null: false, foreign_key: true
      t.string :name
      t.text :description

      t.timestamps
    end
  end
end

Ideally it would look like this (mostly the same, but without the description line):

class CreateTasks < ActiveRecord::Migration[7.1]
  def change
    create_table :tasks do |t|
      t.references :team, null: false, foreign_key: true
      t.string :name

      t.timestamps
    end
  end
end
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