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

Update

I mean, not checking whether there is a privilege or not, but whether it is necessary to write off funds from the account and renew and cancel the subscription.

  • This is so-called. "design decision". You must make your own decisions about the architecture of your own software, since too much needs to be taken into account. In particular, how often do you plan to perform the aforementioned verification. - D-side
  • 2
    make the field "subscription end time" (it may be needed for other places, it can be calculated in the database). Now, it is enough to sort by this field and the user with the “shortest subscription” will be the first (well, or the last :)). Now, you can either just calculate when to check next time, or just watch once an hour / hour (this is even better). Having a sorted list, many questions will disappear (for example, do not need to view all). - KoVadim

0