Skip to content

Proposed changes to payment_processor.subscription #876

@deanpcmad

Description

@deanpcmad

If you have a number of different plans, it can be hard to grab the subscription for a customer.

You can't just do @user.payment_processor.subscription to grab that user's subscription, as it checks by the name.

In the billing code I currently use in one of my apps, which I'm hoping to migrate to Pay, I have a default boolean and then in the account model it's just a has_one association.

has_one :subscription, -> { where(default: true) }, class_name: "Billing::Subscription"

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions