diff --git a/config/environments/test.rb b/config/environments/test.rb index e241e5c4ce..2e14aea9c3 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -58,7 +58,6 @@ Openfoodnetwork::Application.configure do ActiveSupport::Deprecation.behavior = ->(message, callstack, deprecation_horizon, gem_name) do allowed_warnings = [ # List strings here to allow matching deprecations. - "Enumerable.sum", # spec/lib/reports/bulk_coop_report_spec.rb:188 ] unless allowed_warnings.any? { |pattern| message.match(pattern) } ActiveSupport::Deprecation::DEFAULT_BEHAVIORS[:raise].call(message, callstack, deprecation_horizon, gem_name) diff --git a/lib/reporting/reports/bulk_coop/customer_payments.rb b/lib/reporting/reports/bulk_coop/customer_payments.rb index 97752b3feb..4e4da4ce12 100644 --- a/lib/reporting/reports/bulk_coop/customer_payments.rb +++ b/lib/reporting/reports/bulk_coop/customer_payments.rb @@ -21,15 +21,15 @@ module Reporting private def customer_payments_total_cost(line_items) - unique_orders(line_items).sum(&:total) + unique_orders(line_items).map(&:total).sum(&:to_f) end def customer_payments_amount_owed(line_items) - unique_orders(line_items).sum(&:new_outstanding_balance) + unique_orders(line_items).map(&:new_outstanding_balance).sum(&:to_f) end def customer_payments_amount_paid(line_items) - unique_orders(line_items).sum(&:payment_total) + unique_orders(line_items).map(&:payment_total).sum(&:to_f) end def unique_orders(line_items)