annotaterb
annotaterb copied to clipboard
Add support for printing enum types
given rails has more support for postgres enums it would be nice if annotate included more info for a given enum, e.g. given i have a migration like this
create_enum :billing_method, %w[agency_bill direct_bill_to_insured]
add_column :policies, :billing_method, :enum, enum_type: :billing_method, null: true
we get an annotation like this:
# == Schema Information
#
# Table name: policies
#
# id :uuid not null, primary key
# billing_method :enum
it would be nice to get more info on the enum, e.g.
# == Schema Information
#
# Table name: policies
#
# id :uuid not null, primary key
# billing_method :enum enum_type: billing_method
#
# Enums
#
# billing_method agency_bill, direct_bill_to_insured
Hi @schpet thanks for submitting a detailed request. I think it shouldn't be too hard to add, but at the moment I do not have the time to work on it.
However, I am adding labels to invite anyone to submit a PR for it. If you want to take a stab at adding the feature I would definitely be able to provide support there.