Files
fizzy/saas/app/models/account/billing.rb
T
Jorge Manrubia 3ef5e4eeef Add record to track overridden limits
Before, we were relying on just changing the cards_count in account, but this
could create problems where the system to calculate the next card number fails due
to the unique constraint.
2025-12-16 12:00:23 +01:00

20 lines
352 B
Ruby

module Account::Billing
extend ActiveSupport::Concern
included do
has_one :subscription, class_name: "Account::Subscription", dependent: :destroy
end
def plan
active_subscription&.plan || Plan.free
end
def active_subscription
subscription if subscription&.active?
end
def subscribed?
subscription.present?
end
end