ctran / annotate_models

Annotate Rails classes with schema and routes info
Other
4.4k stars 598 forks source link

[3.1.1] Annotate reads the default value from ActiveRecord::Enum. This bug or feature? #839

Open denisoster opened 3 years ago

denisoster commented 3 years ago

Annotate reads the default value from ActiveRecord::Enum This bug or feature?

ALTER TABLE table_name ADD field INTEGER NOT NULL DEFAULT 0;

#  field      :integer          default("UDP"), not null

Version

@drwl @sashabelozerov @ctran

ixti commented 1 year ago

I think this is a bug. Because in DB default is definitely not a string. I'm affected by this as well :((

drwl commented 1 year ago

@ixti in case you're curious, I talk about this on my repo https://github.com/drwl/annotaterb/issues/57. tl;dr if it was easy to support db level annotations then I would.