From 6be20e5c6aed3d8943ffcddee2f05f8cd21b9ed5 Mon Sep 17 00:00:00 2001 From: Benjamin-Couey Date: Mon, 6 Jan 2025 06:26:29 -0700 Subject: [PATCH] Removed unused by_donation_count function --- app/models/manufacturer.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/models/manufacturer.rb b/app/models/manufacturer.rb index 8c49dae9b4..9d18e01f29 100644 --- a/app/models/manufacturer.rb +++ b/app/models/manufacturer.rb @@ -37,17 +37,6 @@ def self.by_donation_date(count = 10, date_range = nil) .limit(count) end - def self.by_donation_count(count = 10, date_range = nil) - # selects manufacturers that have donation qty > 0 in the provided date range - # and sorts them by highest volume of donation - joins(donations: :line_items).where(donations: { issued_at: date_range }) - .select('manufacturers.*, sum(line_items.quantity) as donation_count') - .group('manufacturers.id') - .having('sum(line_items.quantity) > 0') - .order('donation_count DESC') - .limit(count) - end - private def exists_in_org?