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
I take the advice of rubocop very seriously. But I tend to disagree on situation like this:
find_duplicate_records.rb:38:3: C: Name reduce arguments |a, e| (accumulator, element). db.reduce([]) { |a, (_, ids)| a << ids if ids.size > 1 ; a } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ find_duplicate_records.rb:38:59: C: Do not use semicolons to terminate expressions. db.reduce([]) { |a, (_, ids)| a << ids if ids.size > 1 ; a }
I think by using pattern matching, |a (_, ids)| is better than using |a, e| then call e[1] in the block.
The text was updated successfully, but these errors were encountered:
Yep, we've forgotten to take this into account. On a somewhat unrelated note - in your particular case you'll be better served by each_with_object.
each_with_object
Sorry, something went wrong.
Thank you! I love each_with_object, that's the correct way.
2b0de5c
No branches or pull requests
I take the advice of rubocop very seriously. But I tend to disagree on situation like this:
I think by using pattern matching, |a (_, ids)| is better than using |a, e| then call e[1] in the block.
The text was updated successfully, but these errors were encountered: