Skip to content

Commit

Permalink
Replace pluck with map
Browse files Browse the repository at this point in the history
  • Loading branch information
Goose97 committed Apr 9, 2024
1 parent 64e481d commit bf2ae9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rubocop/custom_cops/class_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ def validate_expressions_order(expressions)
expressions.each_cons(2) do |first, second|
next unless EXPRESSION_TYPE_ORDER[first[:category]] > EXPRESSION_TYPE_ORDER[second[:category]]

categories = expressions.map { |expression| expression[:category] }
add_offense(
second[:expression],
message: error_message(second[:category], expressions.pluck(:category))
message: error_message(second[:category], categories)
)
end
end
Expand Down

0 comments on commit bf2ae9f

Please sign in to comment.