No Settled Transactions is 0, not Null Unexpectedly this doesn't return either no columns or a column with a value of 0, but instead a column with no value...
1 files changed, 1 insertions(+), 1 deletions(-) M lib/trust_level_repo.rb
M lib/trust_level_repo.rb => lib/trust_level_repo.rb +1 -1
@@ 27,7 27,7 @@ protected def fetch_settled_amount(customer_id) db.query_one(<<~SQL, customer_id, default: {}) SELECT SUM(amount) AS settled_amount FROM transactions SELECT COALESCE(SUM(amount), 0) AS settled_amount FROM transactions WHERE customer_id=$1 AND settled_after < LOCALTIMESTAMP AND amount > 0 SQL end