ctran/annotate_models

YARD formatter doesn't bigint types well

Opened this issue · 0 comments

I wanted to switch the default formatter to YARD and from what I see bigint columns are not interpreted correctly

Commands

bundle exec annotate --models --show-foreign-keys -f yard

Before/after switching to YARD format

Please notice the @return [] part

--- a/app/models/team.rb
+++ b/app/models/team.rb
@@ -4,23 +4,40 @@
 #
 # Table name: teams
 #
-#  id                                                  :bigint           not null, primary key
-#  name                                                :string
-#  organization_id                                     :bigint           not null
+# @!attribute id
+#   @return []
+# @!attribute name
+#   @return [String]
+# @!attribute organization_id
+#   @return []

Expected behavior

for bigint columns(id, organization_id) I believe it should be the following instead:

+# @!attribute id
+#   @return [Integer]
+# @!attribute organization_id
+#   @return [Integer]

Version

  • annotate version 3.2.0
  • rails version 6.1.5.1
  • ruby version 3.1.2