Skip to content

Commit

Permalink
Refactor allocation distribution to remove debug output and ensure pr…
Browse files Browse the repository at this point in the history
…oper sum calculation
  • Loading branch information
andrew committed Mar 5, 2025
1 parent f3f0202 commit 39c7ef6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/models/allocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ def allocate_funds_by_score(scores, total_score)
end

def distribute_leftover_funds(allocations)
puts allocations.inspect

total_allocated = allocations.sum { |a| a[:allocation].to_i }
total_allocated = allocations.sum { |a| a[:allocation] }
leftover = total_cents - total_allocated

allocations.first[:allocation] += leftover if leftover.positive?
Expand Down

0 comments on commit 39c7ef6

Please sign in to comment.