lib/subscription.rb
# sends an expiration email, then downgrades to a free plan
sends an expiration email, then downgrades to a free plan
sends an expiration email then downgrades to a free plan
def expire!
    Freemium.activity_log[self] << "expired!" if Freemium.log?
    Freemium.mailer.deliver_expiration_notice(subscribable, self)
    self.subscription_plan = Freemium.expired_plan
    cancel_in_remote_system
    self.billing_key = nil
    self.save!
  end
def expire! Freemium . activity_log [ self ] << "expired!" if Freemium . log? Freemium . mailer . deliver_expiration_notice ( subscribable , self ) self . subscription_plan = Freemium . expired_plan cancel_in_remote_system self . billing_key = nil self . save! end
sends an expiration email, then downgrades to a free plan
sends an expiration email then downgrades to a free plan
# downgrade to a free plan # cancel whatever in the gateway # throw away this billing key (they'll have to start all over again) # save all changes