From 15b55015698b5b5ab8bab9a9e307c0d18c741a65 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 18 Apr 2023 08:34:25 -0500 Subject: [PATCH] Better plan setup error If somehow we try to bill with no plan, give a better error --- lib/customer_plan.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/customer_plan.rb b/lib/customer_plan.rb index 8ca01653ddd193276f4e2813295aa997b9dba616..74865c3287809f05b27e9db17cff9aa880d63821 100644 --- a/lib/customer_plan.rb +++ b/lib/customer_plan.rb @@ -128,6 +128,8 @@ class CustomerPlan protected def charge_for_plan(note) + raise "No plan setup" unless @plan + params = [ @customer_id, "#{@customer_id}-bill-#{plan_name}-at-#{Time.now.to_i}",