Open tk0miya opened 1 year ago
Now rebased on #274 .
Unfortunately, this approach doesn't work when instance_methods: false
in the enum
options. However, I think it's preferable to parsing both the old definition style and the new definition style, and it handles enums defined outside the model file.
Since Rails7, the enum definition style has been changed. This uses a private a private method
#_enum_methods_module
to obtain the registered enum defintions to support both Rails5 and Rails7.Thanks to @ksss. (refs: https://github.com/pocke/rbs_rails/issues/6)
This is yet another version of https://github.com/pocke/rbs_rails/pull/267 (static analytics approach).