-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Rails/EnumSyntax
fails to detect non-literal mapping Hashes
#1343
Labels
bug
Something isn't working
Comments
Earlopain
added a commit
to Earlopain/rubocop-rails
that referenced
this issue
Sep 1, 2024
I don't believe there is any issue with just looking at all value types. It just translates `foo: bar` into `:foo, bar`.
Earlopain
added a commit
to Earlopain/rubocop-rails
that referenced
this issue
Sep 1, 2024
I don't believe there is any issue with just looking at all value types. It just translates `foo: bar` into `:foo, bar`.
9 tasks
Earlopain
added a commit
to Earlopain/rubocop-rails
that referenced
this issue
Sep 1, 2024
I don't believe there is any issue with just looking at all value types. It just translates `foo: bar` into `:foo, bar`.
Earlopain
added a commit
to Earlopain/rubocop-rails
that referenced
this issue
Sep 1, 2024
I don't believe there is any issue with just looking at all value types. It just translates `foo: bar` into `:foo, bar`.
Earlopain
added a commit
to Earlopain/rubocop-rails
that referenced
this issue
Sep 3, 2024
I don't believe there is any issue with just looking at all value types. It just translates `foo: bar` into `:foo, bar`. Additionally, add `instance_methods` as a rails option. Not doing this would result autocorrect treating it as a enum column
koic
added a commit
that referenced
this issue
Sep 3, 2024
[Fix #1343] False negatives for `Rails/EnumSyntax`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The recently-introduced
Rails/EnumSyntax
cop successfully works with literal mapping Hashes. e.g.However, it fails to detect non-literal mapping Hashes, e.g.
Expected behavior
The second example above should be flagged as a violation, and should be auto-corrected to:
Actual behavior
The example is not detected as an issue.
Steps to reproduce the problem
Add the following lines to a model file and see the difference in reported violations when running
bundle exec rubocop
RuboCop version
The text was updated successfully, but these errors were encountered: