If a user has no balance, then their balance is 0
1 files changed, 2 insertions(+), 2 deletions(-) M bin/billing_monthly_cronjob
M bin/billing_monthly_cronjob => bin/billing_monthly_cronjob +2 -2
@@ 179,8 179,8 @@ end db.transaction do db.exec( <<-SQL SELECT customer_id, plan_name, expires_at, balance FROM customer_plans INNER JOIN balances USING (customer_id) SELECT customer_id, plan_name, expires_at, COALESCE(balance, 0) AS balance FROM customer_plans LEFT JOIN balances USING (customer_id) WHERE expires_at <= NOW() SQL ).each do |row|