Better plan setup error

Stephen Paul Weber created

If somehow we try to bill with no plan, give a better error

Change summary

lib/customer_plan.rb | 2 ++
1 file changed, 2 insertions(+)

Detailed changes

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}",