Remove Performance/Detect rubocop rule

After upgrading the rubocop-performance gem, we're asked to change this
code:

milestones.select { |milestone| milestone.image.present? }.last

To:

milestones.reverse.find { |milestone| milestone.image.present? }

IMHO the original code is easier to read, so the performance gain isn't
worth it.
This commit is contained in:
Javi Martín
2020-06-09 14:41:22 +02:00
parent 199d8ff609
commit 5315f34c72

View File

@@ -186,9 +186,6 @@ Lint/UselessAssignment:
Performance/CompareWithBlock:
Enabled: true
Performance/Detect:
Enabled: true
Performance/DoubleStartEndWith:
Enabled: true