~singpolyma/sgx-jmp

c29b1566bf579a8fb1d413ed62dfcc9107de6690 — Stephen Paul Weber 1 year, 7 months ago df67870
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