Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# app/models/subscription.rb
class Subscription < ActiveRecord::Base
belongs_to :user
belongs_to :purchase_plan # this can be optional if you have annual or monthly plans for example
has_many :subscription_items, dependent: :destroy # I'm going to explain this later
enum status: ['define_your_possible_statuses']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.