Skip to content

Commit

Permalink
Removed unused by_donation_count function
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin-Couey committed Jan 6, 2025
1 parent f1258c9 commit 6be20e5
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions app/models/manufacturer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 6be20e5

Please sign in to comment.