Why not just use a
varcharand an inclusion validator? It would require some pretty extensive code changes to make enums work here, and I don’t think it’s a case we need to support. This is more of a feature request, and should probably go on the mailing list.
In other words, don’t use an
enum :x_type for
belongs_to :x, polymorphic: true. Use
validates :x_type, inclusion: [...] instead.
If done correctly, this can be machine-verifiable documentation for expected types.