Skip to content

Commit

Permalink
Merge aba187b into 93118d7
Browse files Browse the repository at this point in the history
  • Loading branch information
viroulep committed Jan 28, 2020
2 parents 93118d7 + aba187b commit b816409
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion WcaOnRails/app/models/registration.rb
Expand Up @@ -103,7 +103,11 @@ def entry_fee

def paid_entry_fees
Money.new(
registration_payments.sum(:amount_lowest_denomination),
# NOTE: we do *not* sum on the association, as it bypasses any clean
# registration.includes(:registration_payments) that may exist.
# It's fine to turn the associated records to an array and sum on ithere,
# as it's usually just a couple of rows.
registration_payments.map(&:amount_lowest_denomination).sum,
competition.currency_code,
)
end
Expand Down

0 comments on commit b816409

Please sign in to comment.