-
Notifications
You must be signed in to change notification settings - Fork 661
Open
Description
After generating annotations using the Yard doc format, running migrations does not update the annotations.
Commands
bundle exec annotate --models -f yard
Generates:
# == Schema Information
#
# Table name: users
#
# @!attribute id
# @return []
# @!attribute name
# @return [String]
# @!attribute created_at
# @return [Time]
# @!attribute updated_at
# @return [Time]
#
class User < ApplicationRecord
end
Generate a new migration and migrate:
> rails g migration add_email_to_users email:string
> rails db:migrate
== 20200322114415 AddEmailToUsers: migrating ==================================
-- add_column(:users, :email, :string)
-> 0.0019s
== 20200322114415 AddEmailToUsers: migrated (0.0020s) =========================
Manually run annotations, but annotations are not updated:
› bundle exec annotate --models -f yard
Model files unchanged.
Version
- annotate version: 3.1.1
- rails version: 6.0.2.2
- ruby version: 2.6.5
Notes
I believe the source of the problem is the regular expression used to extract columns from the annotation blob:
column_pattern = /^#[\t ]+[\w\*`]+[\t ]+.+$/ |
Metadata
Metadata
Assignees
Labels
No labels