annotate_models
annotate_models copied to clipboard
Add parentheses in allowed column pattern for commented columns
This PR adds parentheses in allowed column pattern for commented columns.
The annotation of a model with commented columns is not updated even if the column will be updated.
Steps to reproduce
- Create a new Rails application and use MySQL or PostgreSQL database
- Add annotate_models gem in Gemfile
- Create a model with a commented column
- e.g.
-
create_table :users do |t| t.string :name, comment: 'first_name + last_name' t.string :email, null: false t.timestamps end
- Change the commented column from default null to non-null.
- e.g.
-
change_column_null :users, :name, false
- The annotation of the model isn't updated
-
Model files unchanged. - but, schema.rb is updated.
-
-ActiveRecord::Schema[7.0].define(version: 2023_12_03_034600) do +ActiveRecord::Schema[7.0].define(version: 2023_12_03_040324) do create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| - t.string "name", comment: "first_name + last_name" + t.string "name", null: false, comment: "first_name + last_name" t.string "email", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false
-