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?