Closed AndrewSpeed closed 4 years ago
It turns out the gem does support this behaviour :man_facepalming:
I've added a PR containing a test covering this functionality and updated the README with an example
@AndrewSpeed Sorry for the slow responses 😕 My GitHub notifications are so noisy it's hard to see anything.
No problem at all @alassek, mine are exactly the same way 😄
Thanks for merging the PR 🎉
👋 I ran into another use case which
activerecord-pg_enum
doesn't seem to support yet, and wanted to start a discussion about whether we would want to support it, and if so how it would be implemented.As with #3, I'm happy to attempt implementing this change, if it's decided that we want to support it.
Example
When using
activerecord-pg_enum
, we can't specify any of the options supported by theActiveRecord::Enum
class, e.g.prefix
andsuffix
.This means that two enums with the same keys will collide when it comes to the autogenerated methods provided by this class, for example:
Rails enum
Proposed activerecord-pg_enum implementation
One option to implement this behaviour could be to accept any options to the
include
and pass them through to theActiveRecord::Enum
in the module definition