I would like to control the number of invitations per user
I know that I can make some configurations to devise_invitable in my config/initializers/devise.rb file, and limit how many users I want to invite for example:
# initializer/devise.rb
# Number of invitations users can send.
...
config.invitation_limit = 5
But I want is that depending on the type of user I can invite more or less people.
If I have a role type administrator then it would be something like config.invitation_limit = 10
If I have a common user role then I can invite only 3 people and so respectively
The documentation states:
You could set the invitation_limit on create.
If you allow changes to the role after creation you may use
before_save.Or you could override the invitation_limit method: