From 3f6dd59dfa21ef7dc9accb15a44634f330e704ad Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 23 Apr 2026 13:48:17 +0000 Subject: [PATCH] Rubocop: Rails/RedundantActiveRecordAllMethod --- .rubocop_todo.yml | 1 - spec/models/harvest_spec.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9f508a03b..3e966029a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -614,7 +614,6 @@ Rails/RedundantActiveRecordAllMethod: - 'app/controllers/scientific_names_controller.rb' - 'spec/features/members/deletion_spec.rb' - 'spec/features/percy/percy_spec.rb' - - 'spec/models/harvest_spec.rb' # Offense count: 5 # This cop supports unsafe autocorrection (--autocorrect-all). diff --git a/spec/models/harvest_spec.rb b/spec/models/harvest_spec.rb index 586d99001..535dedd4c 100644 --- a/spec/models/harvest_spec.rb +++ b/spec/models/harvest_spec.rb @@ -144,7 +144,7 @@ describe Harvest do it 'lists most recent harvests first' do @h1 = create(:harvest, created_at: 1.day.ago) @h2 = create(:harvest, created_at: 1.hour.ago) - expect(described_class.all.order(created_at: :desc)).to eq [@h2, @h1] + expect(described_class.order(created_at: :desc)).to eq [@h2, @h1] end end