Search code examples
ruby-on-railsrubydevisedevise-invitable

Increment Invitations Counter with Devise Invitable


I am trying to test my application with Devise Invitable to run out of invitations (reach invitation limit) but I cannot get the invitations count to increment at all. Does anyone know how this works?


Solution

  • An idea would be is to add a column to the devise invitable table

    so add a column view_count

    and then in the controller that fires the call use

    @var.increment!(:view_count)
    

    Now you would be able to use the view_count and put a condition around it, as it would increment every time the action is called.