From fe26f33e0aa0b58485aad78e3051dfcbe1349008 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 6 Nov 2023 10:51:52 -0500 Subject: [PATCH] Fix `Rails/RedundantActiveRecordAllMethod` cop (#26885) --- app/lib/delivery_failure_tracker.rb | 2 +- spec/lib/vacuum/imports_vacuum_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/delivery_failure_tracker.rb b/app/lib/delivery_failure_tracker.rb index c90716632..d93826982 100644 --- a/app/lib/delivery_failure_tracker.rb +++ b/app/lib/delivery_failure_tracker.rb @@ -62,7 +62,7 @@ class DeliveryFailureTracker key.delete_prefix(exhausted_deliveries_key_by('')) end - domains - UnavailableDomain.all.pluck(:domain) + domains - UnavailableDomain.pluck(:domain) end def warning_domains_map(domains = nil) diff --git a/spec/lib/vacuum/imports_vacuum_spec.rb b/spec/lib/vacuum/imports_vacuum_spec.rb index 1e0abc5e0..c712b7b9b 100644 --- a/spec/lib/vacuum/imports_vacuum_spec.rb +++ b/spec/lib/vacuum/imports_vacuum_spec.rb @@ -13,7 +13,7 @@ RSpec.describe Vacuum::ImportsVacuum do describe '#perform' do it 'cleans up the expected imports' do - expect { subject.perform }.to change { BulkImport.all.pluck(:id) }.from([old_unconfirmed, new_unconfirmed, recent_ongoing, recent_finished, old_finished].map(&:id)).to([new_unconfirmed, recent_ongoing, recent_finished].map(&:id)) + expect { subject.perform }.to change { BulkImport.pluck(:id) }.from([old_unconfirmed, new_unconfirmed, recent_ongoing, recent_finished, old_finished].map(&:id)).to([new_unconfirmed, recent_ongoing, recent_finished].map(&:id)) end end end