annotate_models
annotate_models copied to clipboard
Comments by multi-byte characters are ignored
Hi, everyone. So thank you for great product.
I occurred in trouble and want to hear everyone's opinion.
I'm Japanese developer so often add some comment for each database column in Japanese.
For example:
create_table "users", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci", comment: "ã¦ã¼ã¶", force: :cascade do |t|
t.string "name", null: false, comment: "åå"
t.string "email", null: false, comment: "ã¡ã¼ã«ã¢ãã¬ã¹"
end
However, they're ignored because they don't match a regular expression which checks diff between old schema and new schema, It's specified here.
If we don't have any problems, I want to fix the problem as follows.
# current
column_pattern = /^#[\t ]+[\w\*\.`]+[\t ]+.+$/
# I expect
column_pattern = /^#[\t ]+[^\t ]+[\t ]+.+$/
What do you think?
Commands
$ bundle exec annotate
Model files unchanged.
Version
- annotate version
- 3.1.1
- rails version
- 6.0.3.2
- ruby version
- 2.7.1
Same here
Same here
Same here
Same here