Skip to main content
Ask A Question
You’re not receiving notifications from this thread.

Restrict Rails Model To Create after Certain Condition

General • Asked by sid d


We have implemented Passport where any user can subscribe to this passport. I want to restrict subscriptions after 20 subscriptions happen. How can we go with this.

Any ideas ?

You could use something like Pundit to count the number of subscriptions and cause something else to happen or prevent it from working at that point. Check out this episode

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 31,152+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.