We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, Rails/Pluck only detects symbol keys, such as:
Rails/Pluck
[ { a: 42 }].map { |x| x[:a] } # cop recommends [ { a: 42 }].pluck(:a)
but not String keys:
[ { 'a' => 42 }].map { |x| x['a'] } # cop ignores
pluck() supports both Symbols and Strings, so it seems like this cop should work on both datatypes. It might actually work for any literal:
pluck()
[ { false => 42 } ].pluck(false) # => [42]
The text was updated successfully, but these errors were encountered:
[Fix rubocop#787] Make Rails/Pluck aware of all keys
1e83c14
Fixes rubocop#787. This PR makes `Rails/Pluck` aware of all keys.
Merge pull request #789 from koic/make_rails_pluck_aware_of_all_keys
51d26a1
[Fix #787] Make `Rails/Pluck` aware of all keys
Successfully merging a pull request may close this issue.
Currently,
Rails/Pluck
only detects symbol keys, such as:but not String keys:
pluck()
supports both Symbols and Strings, so it seems like this cop should work on both datatypes. It might actually work for any literal:The text was updated successfully, but these errors were encountered: