0

The Railscast about Stripe uses a subscription model. When setting up Devise one sets up a user model. What should we do when using Stripe with Devise? Should I setup an association between the User (has_one) and the Subscription? Should I setup the subscription info in the User? Which option is better for the long term as an application grows?

Thank you

4

1 回答 1

0

这取决于。(你知道这即将到来)

如果您想允许多个订阅,或者用户可以通过多种不同方式访问的复杂计费场景,那么让订阅成为它自己的对象。

如果每个用户都有 1 个计费设置,例如您的应用始终为每个用户提供 1 张信用卡,那么将其设置为您的用户的属性。

于 2012-09-23T19:16:11.580 回答