-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enum value accessors should be opt-in #5254
Comments
Yeah, that makes sense. I'll make them opt-in in #5255. |
Hey @rmosolgo, Will this also solve this issue? |
Thanks @gmac ! |
🚢 2.4.11! Thanks again for sharing your thoughts on this. |
The docs need to be updated to reflect this by the way. Additionally, in the changelog this should really be considered a breaking change not a bug fix. I bumped versions to pick up the CVE fix and found out this broke a few things. |
Describe the bug
I'm going to upgrade this discussion to a formal bug report. The changes made in #5206 are both niche and problematic and should not be a default library feature. Here's an excellent example of why:
So, an Enum can't include a
NAME
value without conflicting with Ruby, or requires manual intervention to reconcile the conflict. Now apply this to all other common methods that Ruby implements that are probably also common enum values (class
, etc). This feature is not valuable enough to be on by default.IMO the base library should specify
value_method: false
, then do something like this:As a side note, this feature doesn't make a lot of sense to me because the only logical remediation for the
NAME
conflict would be to change the Enum value, lest the accessor become inconsistent – which kind of defeats the purpose. I'm not sure what we really made better here.Versions
2.4.9
The text was updated successfully, but these errors were encountered: