collab: Allow starting a trial from Zed Free (#30970)

This PR makes it so a user can initiate a checkout session for a Zed Pro
trial while on the Zed Free plan.

Release Notes:

- N/A

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Marshall Bowers 2025-05-19 15:39:01 -04:00 committed by GitHub
parent 5c4f9e57d8
commit b440e1a467
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 56 additions and 29 deletions

View file

@ -236,7 +236,9 @@ impl Database {
.filter(
billing_customer::Column::UserId.eq(user_id).and(
billing_subscription::Column::StripeSubscriptionStatus
.eq(StripeSubscriptionStatus::Active),
.eq(StripeSubscriptionStatus::Active)
.or(billing_subscription::Column::StripeSubscriptionStatus
.eq(StripeSubscriptionStatus::Trialing)),
),
)
.count(&*tx)