Ruby

Ruby

Made by DeepSource

Ambiguous association of block with method RB-LI1001

Bug risk
Major

Params to the method are passed without parentheses. The brace form of a block will bind to the last parameter, not to the overall invocation.

Bad practice

some_method a { |val| puts val }

Recommended

# With parentheses, there's no ambiguity.
some_method(a) { |val| puts val }