P
P
Pavel Grudinkin2016-10-24 23:08:00
PostgreSQL
Pavel Grudinkin, 2016-10-24 23:08:00

How to organize a subscription in a rails project?

There is a service with configured devise and cancan. You need to make a premium subscription with a number of benefits for the user. How is it usually organized to check that the subscription has expired / is active?
The only option that comes to mind is checking all users on a schedule, which, it seems to me, is not very correct.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Andreev, 2016-10-24
@Hunt666

I would make the field "active until", per user.
And if this field is greater than the current time - the subscription is active.
When paying, we add time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question