When no plan, all plan attributes are nil
1 files changed, 2 insertions(+), 2 deletions(-) M lib/customer_plan.rb
M lib/customer_plan.rb => lib/customer_plan.rb +2 -2
@@ 11,12 11,12 @@ class CustomerPlan def initialize(customer_id, plan: nil, expires_at: Time.now) @customer_id = customer_id - @plan = plan + @plan = plan || OpenStruct.new @expires_at = expires_at end def active? - @plan && @expires_at > Time.now + plan_name && @expires_at > Time.now end def bill_plan